Search found 230 matches

by darioit
19 Aug 2010 06:47
Forum: DOS Batch Forum
Topic: Variable problem
Replies: 3
Views: 4479

Variable problem

Hello everybody, I have this problem, I want to load a file in array and after display the resul of both variable, this is a code @echo off&setlocal :: (list.txt = 1234;abcd) for /f "usebackq tokens=1,2 delims=;" %%a in ("%~dp0list.txt") do set cod%%a=%%b echo %cod1234% (resu...
by darioit
12 Aug 2010 08:04
Forum: DOS Batch Forum
Topic: ampersand problem find in a row
Replies: 3
Views: 5108

Re: ampersand problem find in a row

Thanks aGerman, you're the best, but why the suggestion on this site doesn't work?

http://www.dostips.com/DtTipsStringOper ... veBothEnds
and also this
http://www.dostips.com/DtTipsStringOper ... TrimQuotes

Thanks
Dario
by darioit
12 Aug 2010 04:13
Forum: DOS Batch Forum
Topic: ampersand problem find in a row
Replies: 3
Views: 5108

ampersand problem find in a row

Hello again, this batch really works well, but when in a row there's some "&" ampersand simbol, this is interpreted as a command and divide the outpur result in two line also I got this errors sometimes Numero non valido. Le costanti numeriche sono decimali (17), esadecimali (0x11) o o...
by darioit
11 Aug 2010 05:41
Forum: DOS Batch Forum
Topic: %~tI Expands %I to the date and time of file
Replies: 1
Views: 3228

%~tI Expands %I to the date and time of file

This attribute is used to expand date and time of file.

The time in this format is hh.mm

But if I prefer time in format hh.mm.ss how can I get this value?

Thanks in advance
Dario
by darioit
11 Aug 2010 02:49
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Re: Read input file, create seperate files based on table

Thanks you very mutch now it works very fast, but I have one more question, in a row I have

AA001234 data data & data data

and when I write %name% the simbol "&" is view like a separator and don't write the full row, why?
by darioit
10 Aug 2010 15:29
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Re: Read input file, create seperate files based on table

ok thanks for your suggestion I have simplify all operation and now is very fast, what do you think is correct writing code in this way? @echo off &setlocal pushd "E:\bat\Temp" for /f "delims=" %%a in (fileinput.txt) do set "name=%%a"&call :procName popd goto :e...
by darioit
10 Aug 2010 09:42
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Re: Read input file, create seperate files based on table

Hello AGerman Thanks a lot it's almous perfect! I make some changes and I have one two more question The first is when I write the data ECHO %name% >> "ADDRESS.%newCode1%.%newCode2%" it's add a blank space at the end of line The second question in when the batch read the code into the tabl...
by darioit
10 Aug 2010 01:01
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Re: Read input file, create seperate files based on table

layout input file: col 1-2 'AA' code product col 3-4 "00" start data or "99" end data col 5-8 "1234" old code table1 (4 char + 8 char fix) 1234;000milan 5678;0000rome table2 (2 char + 12 char fix) AA;ABCDEFG_0000 BB;QWERTYO_0000 name of new file with insire record from ...
by darioit
09 Aug 2010 15:39
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Re: Read input file, create seperate files based on table

Are all files you want to rename in the same folder? yes Are always the first 4 characters used for the new files too? variable Is the length of (old) code always 4 characters? yes it depends on table, but yes 4 What file extensions do the old file names have? g00v00xxx where xxx is sequential but o...
by darioit
09 Aug 2010 06:17
Forum: DOS Batch Forum
Topic: Read input file, create seperate files based on table
Replies: 9
Views: 9513

Read input file, create seperate files based on table

Hello I read this article "batch file to read imput file, create seperate files " and I have a issue very similar This is my sequential input file: AA00codeotherdata AAotherdata ...... AA99codeotherdata this is my table: code;newcode .....;......... I'd like to create new file called newfi...
by darioit
09 Aug 2010 03:30
Forum: DOS Batch Forum
Topic: How to move only some file
Replies: 1
Views: 2892

How to move only some file

Hello, I wanna move some file that the name is not "*.new" and I wrote this script Dir /b C:\input\* > C:\a\list.txt For /F %%i in ('findstr /v "new" C:\a\list.txt') do move C:\input\%%i C:\output There's some other elegant method to do the same? Thanks in advance
by darioit
06 Aug 2010 12:10
Forum: DOS Batch Forum
Topic: Set variable depends on if
Replies: 2
Views: 3978

Re: Set variable depends on if

oh thanks, I have activate only "setlocal enableextensions", thanks for the help, now it works very cool
by darioit
06 Aug 2010 07:17
Forum: DOS Batch Forum
Topic: Set variable depends on if
Replies: 2
Views: 3978

Set variable depends on if

Hello everybody, Why this variable doesn't work? @ECHO OFF SET AA=****************** SET C1=THIS IS THE RIGHT LINE SET C3=................. set cnt_record=1 set rec_tot=2 CALL :check GOTO:EOF :check IF %rec_tot% NEQ %cnt_record% ( SET C1=WRONG LINE SET E1=WRONG RECORDS %cnt_record% SET E2=WRONG RECO...
by darioit
05 Aug 2010 12:43
Forum: DOS Batch Forum
Topic: Find row, manipulate, put in array and write output
Replies: 3
Views: 4427

Re: Find row, manipulate, put in array and write output

Thanks !k
Your modification works fine, but in one case when the row is like this:

A1field1AAAfield2CCCC field3
having a blank before field3 this field is missing, why?
by darioit
05 Aug 2010 07:56
Forum: DOS Batch Forum
Topic: Find row, manipulate, put in array and write output
Replies: 3
Views: 4427

Find row, manipulate, put in array and write output

Hello, please help me to this problem This is a contents of C:\file.txt A1field1AAAfield2CCCCCCfield3 A2otherotherotherotherotherot A3otherotherotherotherotherot A1field1AAAfield2CCCCCCfield3 A2otherotherotherotherotherot A3otherotherotherotherotherot I need to take only record that begins 1,2 with ...