Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
BAT to insert CR at BOF?
Name: Ptrope Date: March 29, 2007 at 12:06:53 Pacific OS: WinXP CPU/Ram: 2.0 Ghz/2 Gb Product: e-Machines
Comment:
I hope someone has an easy answer. I've got about 4000 text files that need to have a carriage return inserted at the BOF in order to properly load into a company database. I can make a batch file that will append a single-line text file to each of the existing files, but it's somewhat clunky; I'm hoping there's a simple way to run a single-line command that will just open the file, add a carriage return, and close it. Thanks!
Name: farmerjoe Date: March 29, 2007 at 13:23:40 Pacific
Reply:
you need a text editor like sed. There are windows ports of it. good luck.
0
Response Number 2
Name: Ptrope Date: March 29, 2007 at 14:53:05 Pacific
Reply:
Thanks for the tip; I'll check it out!
0
Response Number 3
Name: Mechanix2Go Date: March 30, 2007 at 00:51:36 Pacific
Reply:
What is BOF?
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: IVO Date: March 30, 2007 at 02:06:05 Pacific
Reply:
In Printing and Editing documentation BOF is the acronym for "Bottom Of Form" opposite to TOF "Top Of Form" and is referred about margins setting.
Here I suppose it means "Bottom Of File" i.e. the more common EOF.
0
Response Number 5
Name: Mechanix2Go Date: March 30, 2007 at 03:21:25 Pacific
Reply:
"carriage return inserted at the BOF"
This will append a CRLF ]0d0a] pair to the end of the files.
::== @echo off setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%a in ('dir /b *.txt') do ( echo.>>%%a ) ::==
If you want ONLY a CR [no LF] or you want it before EOF [1a] it will take more doing.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 6
Name: Ptrope Date: March 30, 2007 at 04:14:25 Pacific
Reply:
Sorry, I abbreviated "beginning of file" as BOF (het, if EOF is "end of file" it makes sense, right?) The database reports an error when importing the files if there is text in the first line, so I need to insert a blank lineat the beginning of the file. Sorry for the confusion.
0
Response Number 7
Name: Mechanix2Go Date: March 30, 2007 at 04:47:54 Pacific
Reply:
::== topblank.bat @echo off echo.> line0 setLocal EnableDelayedExpansion
ren *.txt *.tx for /f "tokens=* delims= " %%a in ('dir /b/a-d *.tx') do ( copy line0+%%a %%~na.txt > nul ) del *.tx del line0 ::==
===================================== If at first you don't succeed, you're about average.
Summary: Hi I'm trying to write a DOS batch file that will insert part of the filename of each .CSV file in a directory in the contents of that file. Each .CSV filename is in the format "123456_ABCD.csv" where...
Summary: Unless you can find another MEM program that is smaller. I assumed from the description of the project that it would have to run from a CD. The mem program only uses memory while executing. I assum...
Summary: Hello, I want to know how to insert more than one Icon per Item (Line) in a CListCtrl. Up to now I insertet some Items and every one with an Icon in the beginning of the first SubItem. And I know how ...