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
SYSTEMD-TMPFILES(8)						 systemd-tmpfiles					       SYSTEMD-TMPFILES(8)

NAME
systemd-tmpfiles, systemd-tmpfiles-setup.service, systemd-tmpfiles-setup-dev.service, systemd-tmpfiles-clean.service, systemd-tmpfiles- clean.timer - Creates, deletes and cleans up volatile and temporary files and directories SYNOPSIS
systemd-tmpfiles [OPTIONS...] [CONFIGFILE...] System units: systemd-tmpfiles-setup.service systemd-tmpfiles-setup-dev.service systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer User units: systemd-tmpfiles-setup.service systemd-tmpfiles-clean.service systemd-tmpfiles-clean.timer DESCRIPTION
systemd-tmpfiles creates, deletes, and cleans up volatile and temporary files and directories, based on the configuration file format and location specified in tmpfiles.d(5). If invoked with no arguments, it applies all directives from all configuration files. If one or more absolute filenames are passed on the command line, only the directives in these files are applied. If "-" is specified instead of a filename, directives are read from standard input. If only the basename of a configuration file is specified, all configuration directories as specified in tmpfiles.d(5) are searched for a matching file. OPTIONS
The following options are understood: --create If this option is passed, all files and directories marked with f, F, w, d, D, v, p, L, c, b, m in the configuration files are created or written to. Files and directories marked with z, Z, t, T, a, and A have their ownership, access mode and security labels set. --clean If this option is passed, all files and directories with an age parameter configured will be cleaned up. --remove If this option is passed, the contents of directories marked with D or R, and files or directories themselves marked with r or R are removed. --user Execute "user" configuration, i.e. tmpfiles.d files in user configuration directories. --boot Also execute lines with an exclamation mark. --prefix=path Only apply rules with paths that start with the specified prefix. This option can be specified multiple times. --exclude-prefix=path Ignore rules with paths that start with the specified prefix. This option can be specified multiple times. --root=root Takes a directory path as an argument. All paths will be prefixed with the given alternate root path, including config search paths. Note that this option does not alter how the users and groups specified in the configuration files are resolved. With or without this option, users and groups are always resolved according to the host's user and group databases, any such databases stored under the specified root directories are not consulted. -h, --help Print a short help text and exit. --version Print a short version string and exit. It is possible to combine --create, --clean, and --remove in one invocation. For example, during boot the following command line is executed to ensure that all temporary and volatile directories are removed and created according to the configuration file: systemd-tmpfiles --remove --create UNPRIVILEGED --CLEANUP OPERATION systemd-tmpfiles tries to avoid changing the access and modification times on the directories it accesses, which requires CAP_ADMIN privileges. When running as non-root, directories which are checked for files to clean up will have their access time bumped, which might prevent their cleanup. EXIT STATUS
On success, 0 is returned. If the configuration was invalid (invalid syntax, missing arguments, ...), so some lines had to be ignored, but no other errors occurred, 65 is returned (EX_DATAERR from /usr/include/sysexits.h). Otherwise, 1 is returned (EXIT_FAILURE from /usr/include/stdlib.h). SEE ALSO
systemd(1), tmpfiles.d(5) systemd 237 SYSTEMD-TMPFILES(8)
All times are GMT -4. The time now is 04:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy