|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hello,
I would like to convert a file in unix file format to dos file format. This should do the job: sed s/x0a/x0d/ file.in > file.out The file name will have a date part in it (20040416file.txt), that will change every day. Thereforre I would like to use a wilcard instead of actual file name, like this: sed s/x0a/x0d/ *file.txt > *file.txt While that will work, it will create an output exactly as '*file.txt' not the desired 20040416file.txt. I am trying this: for file in *.txt ; do `sed s/x0a/x0d/ $file > $file` ; done However this results in an empty file 20040416file.txt (filesize is 0 (zero)) What change do I have to do to make it working right? Thank you for your time. ![]() |
|
#2
|
||||
|
||||
|
Code:
#!/bin/sh for file in *.C; do sed s/x0a/x0d/ $file > `date "+%Y%m%d"`$file; done
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
another unix 2 dos question
Does anyone know what the "-ascii" option does?
Thanks. svs020550 |
|
#4
|
|||
|
|||
|
try man unix2dos dos2unix
|
|
#5
|
|||
|
|||
|
tvm
I'll tell my mentor who suggested a Google search. svs |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > unix 2 dos file conversion |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|