12-20-2010
Converting windows format file to unix format using script
Hi,
I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix.
My requirement here is that i want to do it automatically using a script i.e. on running a script it should convert all the text files present in a particular directory from windows format to unix format. Now the problem here is all the text files are not having *.txt, some files are present with different file extension but are still text files. So in case if my directory contains any zip file and i run this script blindly to run dos2unix on all the files present in directory, .zip file got corrupted.
So is there any way i can figure out that dos2unix should run only on text files and not on .zip or in other way any means of getting an information that particular file is a text file.
-Sarbjit
10 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
Hey pllz,
ive got a little problem,
i want to convert a bmp of gif or jpg to an unix format (bm)
anybody got any suggestions ?
greets\EJ (1 Reply)
Discussion started by: EJ =)
1 Replies
2. Programming
hi everyone, im new here and am in desperate need of help. I want to convert my 32 bit unix time stamp ' 45d732f6' into a readable format (Sat, 17 February 2007 16:53:10 UTC) using c++.
I have looked around the interent but i just cant make sense of anything. All examples i can find just... (3 Replies)
Discussion started by: uselessprog
3 Replies
3. Shell Programming and Scripting
My input file is Pipe delimited with 10 fields, I am trying to create a tab delimited output file with 6 fields from the provided input file.
Below is sample data
Input file
abc||2|PIN|num||||www.123.com|abc@123.com|
bcd||2|PIN|num|||||abc@123.com|... (3 Replies)
Discussion started by: pasupuleti81
3 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
Is there any way to convert a file which is in UNIX format to a PC format....
Flip command can be used , apart form this command can we have any other way.... like usinf "awk" etc ..... main purpose of not using flip is that my Kshell doesnot support this comamnd.... (1 Reply)
Discussion started by: Samtel
1 Replies
5. Shell Programming and Scripting
Hi All,
Is there any way to convert a file which is in UNIX format to a PC format....
Flip command can be used , apart form this command can we have any other way.... like usinf "awk" etc ..... main purpose of not using flip is that my Kshell doesnot support this comamnd.... (2 Replies)
Discussion started by: Samtel
2 Replies
6. Shell Programming and Scripting
Hello, excuse my English... I'm trying to do a nautilus-script to transform a normal A4 pdf to another pdf with book format, ready to be printed (double sided). I mean, the script put pages in order and also put 2 pages per horizontal A4 page (p.e.: a pdf with 8 pages would look like: 8-1, 2-7,... (2 Replies)
Discussion started by: dokan
2 Replies
7. Shell Programming and Scripting
With reference to , the script posted by dokan fails via a Bash syntax error because my version of pdftk 1.41 has multiple lines matching to "Num", which are stored in the TOTAL variable. If we modify the first non-ignored line of the script from
# Original
TOTAL=$( pdftk "$1" dump_data output |... (1 Reply)
Discussion started by: aldebrn
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am new to shell scripting and exploring it , I have developed few sample shell script but I have developed them on windows xp notepad and then saving them on folder and then testing them on cywgin and running perfectly...but these scripts are in dos format and I want to convert them in unix... (1 Reply)
Discussion started by: rahul125
1 Replies
9. Shell Programming and Scripting
Hi All,
I need help in converting the mentioned file format into desired output format using awk. Could anyone help me in this?
Below is the input..
Date Account Campaign AdGroup Keyword Conversion Revenue Var1 Var2 Var3 Var4 Var5 10 20 30 ... (8 Replies)
Discussion started by: Ravi S M
8 Replies
10. UNIX for Dummies Questions & Answers
My file format:
--------------------------------------------------
Complete Consistency Check
Valid Area : VALID:VALID
Started by : esanwad
Started at : Thu Dec 11 16:04:46 2014
CNA version : R21H04_EC08
Check range : AREA VALID/VALID
... (4 Replies)
Discussion started by: Gautam Banerjee
4 Replies
LEARN ABOUT HPUX
services.window
services.window(4) Kernel Interfaces Manual services.window(4)
NAME
services.window - file containing applications and their associated memory window ID
DESCRIPTION
The file is used by applications using memory windows.
Each line in the file associates an application with a memory window ID. A line in the file cannot start with a space or tab. The format
is a unique name, defining the application, followed by a space/tab, followed by a unique window_id. See the sample file in
Memory windows allows for the starting of a process in a unique or existing memory window where it can create and share objects with other
applications in the same memory window.
The creation of memory windows removes the system wide restriction on shared resources. Without memory windows, 32-bit processes were lim-
ited to 1.75 gigabytes of shared resources. Each memory window allows for the definition of a unique 1 gigabyte quadrant and since multi-
ple memory windows can be defined in a system, the system total for shared resources can exceed the 1.75 gigabyte limitation for 32 bit
processes.
The definition of a memory window is only available for 32-bit processes.
The file provides a central place for memory window applications to associate their memory window IDs. In the event there are any colli-
sions, only a change in is necessary to select another memory window for the entire application. If is not used, and user applications
hard code window IDs in their startup scripts, collisions are not easily detected or easily fixed.
A memory window application uses the command getmemwindow(1M) to extract the application's window_id from the file, and then passes that ID
to the setmemwindow(1M).
Using the same window ID places applications in the same memory window.
EXAMPLES
Below is a example of a file.
AUTHOR
was developed by HP.
FILES
File containing applications' associated window ID.
SEE ALSO
getmemwindow(1M), setmemwindow(1M).
on
services.window(4)