79599035

Date: 2025-04-29 18:54:30
Score: 4.5
Natty: 2.5
Report link

I tried both the below scripts, but i can see the new blank output file generated with no records. Can someone help with me with the working code as i am new to windows scripting.

@echo off
setlocal enabledelayedexpansion
set inputCSV=%1
set outputCSV=%2

(for /f "tokens=*" %%a IN (%inputCSV%) DO (
  set column=0
  set "line="
  for %%i in ( %%a ) do ( 
    set /a column+=1
    set value=%%~i
    if !column!==4 (   
      if "!value!"=="" set "value=0"
    ) 
    set "line=!line!,"!value!"" 
  )
  echo !line:~1!
))>%outputCSV%
@echo off
setlocal enabledelayedexpansion
set inputCSV=%1
set outputCSV=%2

(for /f "tokens=1-4,* delims=," %%a IN (%inputCSV%) DO (
    if "%%d"=="""" (set "value="000"") else (set "value=%%d")
    echo %%a,%%b,%%c,!value!,%%e
))>%output.csv
Reasons:
  • RegEx Blacklisted phrase (3): Can someone help
  • RegEx Blacklisted phrase (1.5): i am new
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Srini