Hi All; I want to print 2 lines after each occurrence of some word in a text file: example file: ---------------------------- text1 text2 text3 ... WORD1 linex liney any text WORD2 linez linew any text2 ------------------------------- i want to have the following in the output: WORD1 linex liney WOR...
I tried it I conclude the following: -When running the file normaly(NO drag input file) ,the working directory is the folder you created the batch file in: eg: "c:\documents and settings\administrator\desktop\new folder" -When dragging the input file to the batch,the working directory is: ...
HI i have the following behaviour!! when dragging an input file to a BATCH file. when using sort %1 >>out.txt ,the output file does not appear in the working directory ,however,if i use the command : type out.txt there is an output. @echo off sort %1 >>f4.txt //No output file APPEARS in the current ...
Yes ,you mentioned the idea of not using %%a with %%a rray.Thank you. i didn't change any token ,i used it as it is.but it included using %%a with %%a rray. But it it good that this happenned so that the idea is highlighted. anyway: the method of using the arrays is clever,and achieved the goal,as w...
I was searching how to print just first line of a text file because this helps and the idea is: for /f %%a in (file.txt) do( echo %%a exit /b ) this is what the code you wrote did for the second file, it printed the first line only of the second file for each line of file1. what i need is to print t...
Hi Orange_batch The output is below: it is not the required lines 1rray1-1rray2-1 2rray1-2rray2-2 3rray1-3rray2-3 4rray1-4rray2-4 5rray1-5rray2-5 6rray1-6rray2-6 7rray1-7rray2-7
It seems there is something wrong with the %% signs
Hi; i am trying to append two text files without new lines as follow: file1.txt ------------- line1 any text here any txt in file1here etc any etc etc file2.txt ------------- any line1- in file 2 txt text any text ccc hdhddh gggg te What i ned to do is to append line1 from file2 to line1 of file1 an...
Hi Dbenham today i noticed something,if the SLOT No 0 does not exist the sorting will start from the first smallest SLOT number until 25 . example If cab MAG SL 30 15 3 30 15 5 30 15 8 ... but the cabinet 30, magazine 15 ,does not have a slot No 0 in the output,then the sorting will start from 3(the...
Hi All; I want to ask about the ^ and the ! used in batch file coding: i need to understand their usage in general,but the below are just examples: Exmples: 1- FOR /F "tokens=* delims==" %%A IN ('SET "" ˆ| FINDSTR.EXE /B "="') DO @ECHO.%%A 2- set str=15 Trailing Spaces ...