0
votes
1answer
125 views

Using DOS batch, read 2nd line in a pipe delimited file and extract date from 3rd column

I need to extract a date from a text file. File is in pipe delimited format. It has series of columns which might or might not have value. I need a date from the 3rd column in second row. After that, ...
1
vote
3answers
59 views

DOS work-around for the “&” character? [duplicate]

DOS doesn't seem to deal well with the "&" character in a string. I'm trying to parse url's, many of which have one or more &'s. If I do something like: set var = ...
1
vote
2answers
359 views

Left-string, variable matching in a DOS command?

Is it possible to do a string pattern match in DOS? For instance I want to do the following: if "%USERNAME" == "abc*" (echo 1) I know the asterisk doesn't work here and I can't find an alternative. ...
0
votes
2answers
440 views

How to extract/copy string from text to DOS batch file

I have a text file output.txt with contents below: **Adapter #0 Enclosure Device ID: 10 Slot Number: 16 Enclusure Device ID: 10 Slot Number: 15** How can copy value "10" from Enclosure Device ID to ...
0
votes
0answers
157 views

Assembly print a string

I'm having a problem printing a string which I read from the keyboard, if the string is the maximum length then it works but if I enter only 3 characters for example I got a blank black space, this is ...
2
votes
2answers
1k views

Batch file to read from filename and make directory

I have .txt files (1 or more) in a directory that I want my batch file to read their filename, get 20 characters starting from the 4th and creating a new directory in the folder. Here is my code: for ...
1
vote
1answer
613 views

how to delete the string before a certain char at dos?

Suppose I have file name text.txt and contains several lines. Each line starts with dayname and finished with a "/" char then the path is added. I just need the file names on the other hand for each ...
1
vote
1answer
247 views

Nesting String Manipulations in DOS

I know you can use string manipulation in DOS like this: echo %TIME% echo %TIME:~0,2% echo %TIME: =0% The output of these three commands would be: 8:36:05.60 8 08:36:12.93 I want to know how ...
1
vote
2answers
1k views

How to IF check and do multiple things else in DOS

===== DOS BATCH FILE===== I am trying to check a variable=="string" then echo message and run program else it must quit exit 1 if anything else or even empty. I have tried so much already and used ...
2
votes
2answers
745 views

How to find if a string is in a list of strings in a DOS batch file

I'd like to check if an argument to a batch file is valid based on a list of strings. For example: IF %1 IN validArgument1, validArgument2, validArgument3 SET ARG=%1 This would set ARG to one of ...
0
votes
2answers
2k views

Batch concatenation string with special characters

Context I check several servers with nmap and I send the result by email. I concatenate a variable with new result for each server and each ports with this code (I removed loops): SET text= SET ...
1
vote
1answer
1k views

Assembly code to display string

I have this piece of assembly code to accept a string and display the string back. My problem is I'm not able to figure out how exactly the name is getting stored in name1 as we are using buff to ...
3
votes
3answers
4k views

DOS batch script to parse CSV file and output a text file

I've seen a response on another page (http://stackoverflow.com/questions/6470570/help-in-writing-a-batch-script-to-parse-csv-file-and-output-a-text-file) - brilliant code BTW - : @ECHO OFF IF ...
0
votes
2answers
3k views

Using DOS batch script: find a line in a properties file and replace text

Trying to replace a string in a properties file on a certain line by using a batch file. I know that this can be done WITHOUT the use of a temp file, as I have seen it before, but forgotten how to do ...
2
votes
1answer
251 views

string gets truncated when passing it as parameter from bat if it has more than 6 spaces

Platform: Windows 7, Windows XP Software: DOS I know about command line length limitation but I never experienced something like this". I have doskey command passing parameters/arguments to vbs ...
0
votes
3answers
4k views

Escaping an equals sign in DOS batch string replacement command

I need to replace some text in a JNLP file using a DOS batch file to tune it for the local machine. The problem is that the search pattern contains an equals sign which is messing up the string ...
1
vote
2answers
1k views

Delphi function to convert a string to DOS format

I'm using the FINDSTR function to filter text files, but it's failling on extended ASCII characters. I tried using the CharToOEM function, but I still have characters such as 'à', which FINDSTR ...
2
votes
6answers
3k views

Passing a multi-line string as an argument to a script in Windows

I have a simple python script like so: import sys lines = sys.argv[1] for line in lines.splitlines(): print line I want to call it from the command line (or a .bat file) but the first ...
2
votes
4answers
941 views

Convert Unix path to DOS path in a Korn shell script

I have a variable that stores a Unix path, for example: typeset unixpath=/foo/bar/ And I have to convert it to a DOS path using Korn shell scripting: dospath=\\foo\\bar\\
0
votes
5answers
754 views

Separating 'body' of domain name from extension - DOS shell

I tried everything possible, but still failed. I thought I got it at the point which I'll post as my final attempt, but still isn't good [enough]. A script is being passed three arguments. Domain ...
4
votes
4answers
8k views

How do I perform string operations on variables in a for loop?

This sounds dumb, but I can't get it to work. I think i just dont' understand the difference between %%v, %v% and %v Here's what I'm trying to do: for %%v in (*.flv) do ffmpeg.exe -i "%%v" -y -f ...