Sponsored Content
Full Discussion: awk misreading txt file
Top Forums Shell Programming and Scripting awk misreading txt file Post 302236819 by Franklin52 on Tuesday 16th of September 2008 10:24:40 AM
Old 09-16-2008
Mac OS places a carriage return character at the end of each line of a text file, but Unix uses a line feed character. Convert the file to a unix format with:

Code:
awk '{gsub("\r", "\n"); print $0;}' macfile.txt > unixfile.txt

Regards
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Binary txt file received when i use uuencode to send txt file as attachment

Hi, I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes.. i wanna attach a text file and send to a mail id..used the following code : uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com it works... (2 Replies)
Discussion started by: ash22
2 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. Shell Programming and Scripting

Select some lines from a txt file and create a new file with awk

Hi there, I have a text file with several colums separated by "|;#" I need to search the file extracting all columns starting with the value of "1" or "2" saving in a separate file just the first 7 columns of each row maching the criteria, with replacement of the saparators in the nearly created... (4 Replies)
Discussion started by: capnino
4 Replies

4. Shell Programming and Scripting

Using csh / awk / sed to compare database sizes in a txt file

Hello, I have an output file showing database sizes across the 3 environments that I use (LIVE, TEST & DEVELOPMENT). I am trying to write a script that lets me know if the size of a db on one environment is different to its corresponding db on the other environments. Here is an example... (4 Replies)
Discussion started by: stevie_g
4 Replies

5. Shell Programming and Scripting

Help with selecting column with awk for a txt file generated by excel

I am new to scripting/programming, so I apologize for any novice questions. I have a tab delimited text file that was saved from excel xls file. I am trying to select only the third column using awk command. My command line is as below: cat test.txt | awk '{print $3}' However, above... (8 Replies)
Discussion started by: SangLad
8 Replies

6. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

7. Shell Programming and Scripting

awk to print value from txt file to csv

Hi, I want to print two columns from a .txt file to a .csv file using awk. data in text file: Application -------------------------------------------------- ----------- OS Related Issues 1 EMEA Solutions ... (8 Replies)
Discussion started by: prashu_g
8 Replies

8. Shell Programming and Scripting

Converting txt file into CSV using awk or sed

Hello folks I have a txt file of information about journal articles from different fields. I need to convert this information into a format that is easier for computers to manipulate for some research that I'm doing on how articles are cited. The file has some header information and then details... (8 Replies)
Discussion started by: ksk
8 Replies

9. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies

10. Shell Programming and Scripting

Awk, sed, shell all words in INPUT.txt find in column1 of TABLE.txt and replce with column2 in

Hi dears i have text file like this: INPUT.txt 001_1_173 j nuh ]az 001_1_174 j ]esma. nuh ]/.xori . . . and have another text like this TABLE.txt j j nuh word1... (6 Replies)
Discussion started by: alii
6 Replies
thai/thwchar.h(3)						      libthai							 thai/thwchar.h(3)

NAME
thai/thwchar.h - Wide char support for Thai. SYNOPSIS
Macros #define THWCHAR_ERR (~(thwchar_t)0) Wide-character value indicating error. Typedefs typedef wchar_t thwchar_t Thai character type for storing Unicode character. Functions thwchar_t th_tis2uni (thchar_t c) Convert character code from TIS-620 to Unicode. int th_tis2uni_line (const thchar_t *s, thwchar_t *result, size_t n) Convert string from TIS-620 to Unicode. thwchar_t th_winthai2uni (thchar_t c) Convert character code from Thai Windows extended code to Unicode. thwchar_t th_macthai2uni (thchar_t c) Convert character code from Mac Thai extended code to Unicode. thchar_t th_uni2tis (thwchar_t wc) Convert character code from Unicode to TIS-620. int th_uni2tis_line (const thwchar_t *s, thchar_t *result, size_t n) Convert string from Unicode to TIS-620. thchar_t th_uni2winthai (thwchar_t wc) Convert character code from Unicode to Thai Windows extended code. thchar_t th_uni2macthai (thwchar_t wc) Convert character code from Unicode to Mac Thai extended code. Detailed Description Wide char support for Thai. Function Documentation thwchar_t th_macthai2uni (thchar_tc) Convert character code from Mac Thai extended code to Unicode. Parameters: c : Mac Thai character/glyph to convert Returns: Corresponding Unicode code thwchar_t th_tis2uni (thchar_tc) Convert character code from TIS-620 to Unicode. Parameters: c : TIS-620 character to convert Returns: Corresponding Unicode code int th_tis2uni_line (const thchar_t *s, thwchar_t *result, size_tn) Convert string from TIS-620 to Unicode. Parameters: s : source TIS-620 string (null-terminated) result : buffer for storing resulting Unicode string n : size of result buffer (as number of elements) Returns: the length of the output Unicode string thchar_t th_uni2macthai (thwchar_twc) Convert character code from Unicode to Mac Thai extended code. Parameters: wc : Unicode code to convert Returns: Corresponding Mac Thai extended code, or TH_ERR if conversion is impossible thchar_t th_uni2tis (thwchar_twc) Convert character code from Unicode to TIS-620. Parameters: wc : Unicode character to convert Returns: Corresponding TIS-620 code, or TH_ERR if conversion is impossible int th_uni2tis_line (const thwchar_t *s, thchar_t *result, size_tn) Convert string from Unicode to TIS-620. Parameters: s : source Unicode string (null-terminated) result : buffer for storing resulting TIS-620 string n : size of result buffer (as number of elements) Returns: the length of the output TIS-620 string Note that, since the conversion is lossy, some characters in the convesion result may be TH_ERR, indicating conversion error. thchar_t th_uni2winthai (thwchar_twc) Convert character code from Unicode to Thai Windows extended code. Parameters: wc : Unicode code to convert Returns: Corresponding Thai Windows extended code, or TH_ERR if conversion is impossible thwchar_t th_winthai2uni (thchar_tc) Convert character code from Thai Windows extended code to Unicode. Parameters: c : Thai Windows character/glyph to convert Returns: Corresponding Unicode code Author Generated automatically by Doxygen for libthai from the source code. Version 0.1.14 Tue Jun 17 2014 thai/thwchar.h(3)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy