Search found 20 matches

by Amin
14 Aug 2012 00:40
Forum: DOS Batch Forum
Topic: print lines after a specific word in text file
Replies: 4
Views: 4749

Re: print lines after a specific word in text file

Thanks Dears for your replies , the files are small , and the solutions are working .
Thanks Dave Benham for your professional and helpful replies!
:D
by Amin
13 Aug 2012 05:02
Forum: DOS Batch Forum
Topic: print lines after a specific word in text file
Replies: 4
Views: 4749

print lines after a specific word in text file

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...
by Amin
13 Oct 2011 05:08
Forum: DOS Batch Forum
Topic: dragging input file to batch
Replies: 4
Views: 4531

Re: dragging input file to batch

I didn't use it before .
Thank you very much !
:)
by Amin
13 Oct 2011 04:13
Forum: DOS Batch Forum
Topic: dragging input file to batch
Replies: 4
Views: 4531

Re: dragging input file to batch

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: ...
by Amin
12 Oct 2011 14:16
Forum: DOS Batch Forum
Topic: dragging input file to batch
Replies: 4
Views: 4531

dragging input file to batch

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 ...
by Amin
24 Jun 2011 06:12
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

Re: append lines of two files without a new line?

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...
by Amin
24 Jun 2011 05:42
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

Re: append lines of two files without a new line?

Regarding the first code from Orange_Batch after changing the %%a as it is available in %%array ,it worked fine.

I tired the codes written after my last reply, these codes are working fine.

Thank you All,
by Amin
23 Jun 2011 06:35
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

Re: append lines of two files without a new line?

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...
by Amin
23 Jun 2011 05:10
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

Re: append lines of two files without a new line?

Hi allal
That code runs the for loop of file2 for every line in file1,so it prints line1 of file1 n times where n is the number of lines in file2.
by Amin
23 Jun 2011 04:41
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

Re: append lines of two files without a new line?

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
by Amin
23 Jun 2011 03:50
Forum: DOS Batch Forum
Topic: append lines of two files without a new line?
Replies: 16
Views: 17508

append lines of two files without a new line?

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...
by Amin
20 Jun 2011 23:45
Forum: DOS Batch Forum
Topic: conditional formatting and sorting
Replies: 9
Views: 9391

Re: conditional formatting and sorting

Dear Dbenham
I tried it and it is working perfectly now, I appreciate it.Thank you very much!
by Amin
20 Jun 2011 05:12
Forum: DOS Batch Forum
Topic: conditional formatting and sorting
Replies: 9
Views: 9391

Re: conditional formatting and sorting

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...
by Amin
06 Jun 2011 01:54
Forum: DOS Batch Forum
Topic: Question about ^ and !
Replies: 8
Views: 10658

Re: Question about ^ and !

Thank you All.
by Amin
06 Jun 2011 00:16
Forum: DOS Batch Forum
Topic: Question about ^ and !
Replies: 8
Views: 10658

Question about ^ and !

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 ...