Search found 15 matches

by pp8771
20 Jul 2018 06:44
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Re: Replacement of Operator

By using %% it does not work. I have tried it. Any other suggestion.
by pp8771
20 Jul 2018 05:03
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Re: Replacement of Operator

Really I am looking for assistance from senior members how to read the delimited files. The code is working for delimiter ~,|,=, # but not for % . can any one has idea what is wrong with this code. Assistance is really appreciated. My file a1.dat is: COMPID%COMPNAME%ADDRESS%YEAROFESTABLISTMENT 100%X...
by pp8771
19 Jul 2018 01:30
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Re: Replacement of Operator

My input file [a1.dat] is COMPID=COMPNAME=ADDRESS=YEAROFESTABLISTMENT 100=XYC=AWER RD=12072018 120=BNM=PQTY RD=12082018 100=XYC=AWER RD=12072018 120=BNM=PQTY RD=12082018 Required output '100','XYC','AWER RD','12072018' '120','BNM','PQTY RD','12082018' '100','XYC','AWER RD','12072018' '120','BNM','PQ...
by pp8771
18 Jul 2018 14:37
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Re: Replacement of Operator

Now modified it for a single line @echo off setlocal enabledelayedexpansion set vffname=D:\a1.dat REM echo !vffname! set "vtilda=^=" REM echo !vtilda! REM echo: FILE SIZE !vsize! set vheader= REM set vcolumnlist= set /p "vheader="<"!vffname!" setlocal :replace for /f "tokens=1*delims=%vtilda%" %%i i...
by pp8771
18 Jul 2018 13:18
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Re: Replacement of Operator

Delimiter will be a parameter and not an hard code value
I want to put that in a variable set "vtilda=~"
by pp8771
18 Jul 2018 04:44
Forum: DOS Batch Forum
Topic: Doing MOD calculations in batch
Replies: 8
Views: 39538

Re: Doing MOD calculations in batch??

Now working
by pp8771
18 Jul 2018 04:18
Forum: DOS Batch Forum
Topic: Replacement of Operator
Replies: 10
Views: 8329

Replacement of Operator

The file a1.dat contains COMPID~COMPNAME~ADDRESS~YEAROFESTABLISTMENT I have written a code to replace the operator ~ by "," and append " in the beginning and end of the line. So written a small code. @echo off setlocal enabledelayedexpansion set vffname=D:\a1.dat REM echo !vffname! set "vtilda=~" RE...
by pp8771
10 Jul 2018 08:03
Forum: DOS Batch Forum
Topic: Doing MOD calculations in batch
Replies: 8
Views: 39538

Re: Doing MOD calculations in batch??

Set /a a = 13 %% 5 giving error missing operand OS Name: Microsoft Windows Server 2008 R2 Standard OS Version: 6.1.7601 Service Pack 1 Build 7601 OS Name: Microsoft Windows Server 2008 R2 Standard OS Version: 6.1.7601 Service Pack 1 Build 7601
by pp8771
25 Jun 2018 04:50
Forum: DOS Batch Forum
Topic: execution of batch
Replies: 1
Views: 2203

execution of batch

I have batch program under folder1 but not able to execute by issuing following commands from run menu

cmd /c ""D:\folder1\a1.bat""

cmd /k ""D:\folder1\a1.bat""

it is giving error access denied
by pp8771
15 Jun 2018 17:24
Forum: DOS Batch Forum
Topic: Reading a delimited file
Replies: 5
Views: 4385

Re: Reading a delimited file

really struggling to read file and print in the above format. Any kind of assistance from experts is really appreciated. Thanks for the earlier assistance . @echo off setlocal enabledelayedexpansion set WORKING_DIRECTORY=%cd% pushD %WORKING_DIRECTORY% REM echo %WORKING_DIRECTORY% for /f "usebackq to...
by pp8771
14 Jun 2018 18:54
Forum: DOS Batch Forum
Topic: Reading a delimited file
Replies: 5
Views: 4385

Re: Reading a delimited file

In that case i will store two things in two variables. One after stripping and one with extension.Thanks for the advise. I have rewritten it. @echo off setlocal enabledelayedexpansion set WORKING_DIRECTORY=%cd% pushD %WORKING_DIRECTORY% REM echo %WORKING_DIRECTORY% for /f "usebackq tokens=*" %%a in ...
by pp8771
13 Jun 2018 23:03
Forum: DOS Batch Forum
Topic: Reading a delimited file
Replies: 5
Views: 4385

Re: Reading a delimited file

Thanks for the response. trrying to answer your question: I am not concatenating the all the file contents into one file but will write to different file by appending file name folder name and line no. Let say I have parent folder (A1). Under the parent folder A1 it has different subfolder A12,A13, ...
by pp8771
13 Jun 2018 01:32
Forum: DOS Batch Forum
Topic: Reading a delimited file
Replies: 5
Views: 4385

Reading a delimited file

I have a very unusual batch requirement. I have file with a header and number of rows which are considered as data in the subsequent rows. Number of header columns can vary and can be determined from the number of delimters. if there are three delimiters in a row - i will have four columns in the fi...
by pp8771
12 Jun 2018 12:00
Forum: DOS Batch Forum
Topic: List directory and files
Replies: 2
Views: 3032

Re: List directory and files

Thanks Phil
by pp8771
12 Jun 2018 07:02
Forum: DOS Batch Forum
Topic: List directory and files
Replies: 2
Views: 3032

List directory and files

Actually i am listing four directories and four files inside those directory and not able to do it properly. @echo off set foldername=D:\Prev_Machine\Pranab\Daimler\Xtech\Training\ for /f "usebackq tokens=*" %%a in (`dir /b/s/a:d %foldername%MigrationPoc`) do ( echo:%%~nxa set file1=%foldername%Migr...