1.

Solve : What Command that promt to Fill In Text?

Answer»

Hi All,

Can you help me how to make a command that can promt & ask to fill in something TEXT. Then that text will be added in the text data file.

Thanks

e-BamSorry, but I don't really understand the question.

So you want a batch file that will ask for text, and when you press Enter it is saved in a text file?1st of all, thanks guys reply my question...

That say I click a batch file, then the dos will promt:

"Please Key In The Invoice No. : "

After you key in the number that say 1234, then this number will be added to the text file.

So,
1. How to make that question appear & functional?
2. How to insert the '1234' to the text file?

Thanks, Your help much2 appreacited.

e-Bam

Here's a code that will do just what you are asking for.

Quote

:start
set /p variable=Please Key In The INvoice No.
echo "%variable%" > some_file
pause>nul
goto start
Thanks dude, I appreaciate that..

I will try to use it..

e-BamThanks guys (BatchFileCommand).. Its working..

e-bamContinue from the last question. Now the situation is;

You have 1 text file called “data.txt” in 1 folder named “SOURCE”.

The data.txt has a numbers of characters as per below:

Bam;060180;engineer
John;050881;executive
Salem;151281;hackers
:
:

When you click the batch file, you will be asking to insert the invoice no. as per yesterday discussion.

The question is, how to make output data.txt file as per below?

Invoice No: 1234
Bam;060180;engineer
John;050881;executive
Salem;151281;hackers
:
:

Please advice..So, you want it to display Quote
Invoice Number:
followed by the invoice number? Simple!

Where it says Quote
echo "%variable%" > some_file
replace that with
Code: [Select]echo Invoice No: "%variable%" > some_file
If you want it to display Invoice No at the begining, that gets a bit tricky...But it's still possible!

Code: [Select]Echo Invoice No: "%variable%" > some_other_file
type data.txt >> some_other_file
type some_other_file > data.txt
del some_other_file
There, that will do it. Here is a step-by-step explanation of the script:
1. Sends "Invoice No: %variable%" to some_other_file which is important.
2. Sends the FULL contents of data.txt to the end of some_other_file.
3. Sends the full contents of some_other_file (part 1 + 2) to data.txt and overrides anything that was previously in data.txt
4. Deletes some_other_file.

Understand? I've understand whats u means. Thanks a lot.

BTW, yesterday I've BUILD up the command like this:

Code: [Select]SET /P VARIABLE=Please Key In DD No. and NAME:
ECHO "%VARIABLE%" > C:\HLA\PAGECOUNT\DDNO\DDNo.txt
PAUSE

REM --- Merge the DDNo.txt with Data file
COPY "C:\HLA\PAGECOUNT\DDNO\DDNo.txt"+"C:\HLA\PAGECOUNT\PDFPROCESS\NGC_DAILY.txt" "C:\HLA\PAGECOUNT\PDFPROCESS\SUBMERGING\NGC_DAILY.txt
I use MERGING command where, I create 1 file DDNo, then merge with the data text. Then its work.

How bout if u want to insert the text line in the middle of data text?

e-Bam


Discussion

No Comment Found