Sponsored Content
Full Discussion: Text file cleanup
Operating Systems OS X (Apple) Text file cleanup Post 302990028 by RudiC on Friday 20th of January 2017 02:52:15 PM
Old 01-20-2017
Not sure if this will work on more sophisticated file structures:
Code:
awk '{sub (/\n"/, _)} 1' RS= file
line 1
line 2line 3

For your new request, try
Code:
awk '{gsub (/\n *"/, _)} 1' RS= file


Last edited by RudiC; 01-20-2017 at 03:59 PM..
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sendmail cleanup

What is the correct procedures to clean up /var/spool/mqueue? Any help appreciated. This directory gets really clogged up at times. :( :( (1 Reply)
Discussion started by: thomi39
1 Replies

2. Shell Programming and Scripting

Help with cleanup

I am trying to add a unique string to a variable to prevent some name space collisions. DATAFILE=/u001/app/unica/affinium644/campaign/partitions/limited/tmp/ebf9aaah.t~# DATETIME=`date +%Y%m%d_%H%M%S` echo $DATAFILE > tmpnme.txt sed 's_/_ _g' tmpnme.txt > tmpnme2.txt DATA=$(cat tmpnme2.txt)... (2 Replies)
Discussion started by: whdr02
2 Replies

3. Shell Programming and Scripting

awk/sed/ksh script to cleanup /etc/group file

Many of my servers' /etc/group file have many userid's that does not exist in /etc/passwd file and they need to be deleted. This happened due to manual manipulation of /etc/passwd files. I need to do this for 40 servers. Can anyone help me in achieving this? Even reducing a step or two will be... (6 Replies)
Discussion started by: pdtak
6 Replies

4. Shell Programming and Scripting

how can I bcp out a table into a text file including the header row in the text file

Hi All, I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers. I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies

5. Shell Programming and Scripting

Cleanup between parenthesis

Hi, I am trying to clean up data between parenthesis () in a file. See example below.... Input File : (New York) Chicago (London) New York (Chicago) London New York Chicago (London) (New York) (Chicago) (London) New York (Chicago) ... (3 Replies)
Discussion started by: msalam65
3 Replies

6. Red Hat

How to Cleanup Multipathing

I have a server running redhat 5.5 and it has one SAN device presented to it as LUN9. How can I clean up the remaining entries. I cannot afford to interupt the service. Please assist. # multipath -l mpath0 (36000097000019260298953666633436) dm-11 EMC,SYMMETRIX \_ round-robin 0 \_ 2:0:0:9 ... (2 Replies)
Discussion started by: Tirmazi
2 Replies

7. UNIX for Dummies Questions & Answers

Converting a text file with irregular spacing into a space delimited text file?

I have a text file with irregular spacing between values which makes it really difficult to manipulate. Is there an easy way to convert it into a space delimited text file so that all the spaces, double spaces, triple spaces, tabs between numbers are converted into spaces. The file looks like this:... (5 Replies)
Discussion started by: evelibertine
5 Replies

8. Shell Programming and Scripting

Cleanup a log file data every 2 days

How do i cleanup a log file data every 2 days, I was using below command in a script to remove log file every 2 days, but looks like its not working as log file date and time gets updated every 5 mins. Is there a way ? find ./ \( -name . -o -prune \) -type f -mtime -2 -name... (9 Replies)
Discussion started by: aix_admin_007
9 Replies

9. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
asa(1)							      General Commands Manual							    asa(1)

NAME
asa - Interprets carriage-control characters SYNOPSIS
asa [file...] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: asa: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
None OPERANDS
The pathname of a file to be read. If this parameter is omitted, standard input is read. DESCRIPTION
The asa command writes its input files to standard output, mapping carriage-control characters from the text files to line-printer control sequences. The first character of every input line is removed and, depending on the character removed, an action performed on that character and the rest of the line. If the character removed is: The rest of the line is output without change. A newline character is output, followed by the rest of the input line. A form-feed character is output, followed by the rest of the input line. The newline character of the previ- ous line is replaced with a carriage-return character, which is output, followed by the rest of the input line. If + is the first character in the input, + has the same effect as the space character. [Tru64 UNIX] The character is output, followed by the rest of the input line. EXIT STATUS
The following exit values are returned: Successful completion. An error occurred. EXAMPLES
To view a file (created by a program using FORTRAN-style carriage control characters) on a terminal: asa file To format the FORTRAN output of a.out and direct it to the printer: a.out | asa | lp ENVIRONMENT VARIABLES
The following environment variables affect the execution of asa: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: lp(1) Standards: standards(5) asa(1)
All times are GMT -4. The time now is 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy