Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to remove a string from a specific column in a file Post 302409771 by auburn on Friday 2nd of April 2010 11:04:54 AM
Old 04-02-2010
Thanks everyone!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove Line that contains specific string

I am looking for a way to remove any line in a text file that contains the string "Mac address". I guess you would grep and sed, but I am not sure how to do this. Thanks for you help. (3 Replies)
Discussion started by: CBarraford
3 Replies

2. UNIX for Dummies Questions & Answers

How to remove columns with specific string?

If I have a data test.txt with 1000 columns such as: id sex gene1 gene2 gene2.dl gene3 gene4 gene4.dl ....... 1 1 AA AT AT TT AT AT ....... 2 1 AG TT TT TA AA AA ....... 3 2 AA AT AT TT AT ... (2 Replies)
Discussion started by: AMBER
2 Replies

3. Shell Programming and Scripting

How to remove delimiter from specific column?

I have 5 column in sample txt file where in i have to create report based upon 1,3 and 5 th column.. I have : in first and third coulmn. But I want to retain the colon of fifth coulmn and remove the colon of first column.. 5th column contains String message (for example,... (7 Replies)
Discussion started by: Shirisha
7 Replies

4. Shell Programming and Scripting

remove special character from a specific column

Hello , i have a text file like this : A123 c12AB c32DD aaaa B123 23DS 12QW bbbb C123 2GR 3RG cccccc i want to remove the numbers from second and third column only. i tried this : perl -pe 's///g' file.txt > newfile.txt but it will remove the number from... (7 Replies)
Discussion started by: shelladdict
7 Replies

5. Shell Programming and Scripting

how to remove tab space only in the column of a specific row

Hi, I need help to remove tab delimited space in the $2 of a specific row. My file is like this:- file1.txt No_1 4 139 156 No_1 5 161 205 No_4 91 227 212 No_19 254 243 263 No_19 645 249 258 No_19 101 2492 2635 No_90 8 277 288... (5 Replies)
Discussion started by: redse171
5 Replies

6. Shell Programming and Scripting

Remove Specific Column in a File using awk

Hi, I would like to ask your expertise to remove specific column no. 8 in the below file using but I don't have an idea on how to simply do this using awk command. Appreciate your help in advance. Input f: ABC 1 1XC CDA 1 2YC CCC 1 3XC AVD 1 3XA Expected output file: ABC 1 1C CDA... (9 Replies)
Discussion started by: zzavilz
9 Replies

7. Shell Programming and Scripting

Replace specific column range in a non-delimited file with a string!

Hi All, I will need an help with respect to replacing a range of columns on a non-delimited file using a particular string pattern. Say file input is MYNUMBERD000000-BAN CHUE INSNTS ** N+ MYAREDSDD000000+BAN CHUE INSNTS ** N+ MYDERFFFSD00000-GIR PENT - ACH ** ... (5 Replies)
Discussion started by: navojit dutta
5 Replies

8. Shell Programming and Scripting

Overwrite specific column in xml file with the specific column from adjacent line

I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file. Here is the file. <!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies

9. Shell Programming and Scripting

Remove lines matching a substring in a specific column

Dear group, I have following input text file: Brit 2016 11 18 12 00 10 1.485,00 EUR Brit 2016 11 18 12 00 10 142,64 EUR Brit 2016 11 18 12 00 10 19,80 EUR Brit 2016 11 18 12 00 10 545,00 EUR Brit 2016 11 18 12 00 10 6.450,00 EUR... (3 Replies)
Discussion started by: gfhsd
3 Replies

10. Shell Programming and Scripting

sed or awk to remove specific column to one range

I need to remove specific column to one range source file 3 1 000123456 2 2 000123569 3 3 000123564 12 000123156 15 000125648 128 000125648 Output required 3 000123456 2 000123569 3 000123564 12 000123156 15 000125648 128 000125648 (6 Replies)
Discussion started by: ranjancom2000
6 Replies
incrontab(5)						       incron documentation						      incrontab(5)

NAME
incrontab - tables for driving inotify cron (incron) DESCRIPTION
An incrontab file contains instructions to the incrond(8) daemon of the general form: "run this command on these file events". There are two categories of tables: system tables (with root privileges) and user tables (with user privileges). System tables are (by default) located in /etc/incron.d and may have any names. Each system table exists separately inside incron and their watches never collide. Each user has their own table, and commands in any given incrontab will be executed as the user who owns the incrontab. System users (such as apache, postfix, nobody etc.) may have their own incrontab. incrontab files are read when the incrond(8) daemon starts and after any change (incrontab file are being hooked when incrond is running). Blank lines are ignored. The general line format is the following: <path> <mask> <command> Where path is an absolute filesystem path, mask is an event mask (in symbolic or numeric form) and command is an executable file (or a script) with its arguments. See bellow for event mask symbols. The executable file may be noted as an absolute path or only as the name itself (PATH locations are examined). Please remember that the same path may occur only once per table (otherwise only the first occurrence takes effect and an error message is emitted to the system log). EVENT SYMBOLS
These basic event mask symbols are defined: IN_ACCESS File was accessed (read) (*) IN_ATTRIB Metadata changed (permissions, timestamps, extended attributes, etc.) (*) IN_CLOSE_WRITE File opened for writing was closed (*) IN_CLOSE_NOWRITE File not opened for writing was closed (*) IN_CREATE File/directory created in watched directory (*) IN_DELETE File/directory deleted from watched directory (*) IN_DELETE_SELF Watched file/directory was itself deleted IN_MODIFY File was modified (*) IN_MOVE_SELF Watched file/directory was itself moved IN_MOVED_FROM File moved out of watched directory (*) IN_MOVED_TO File moved into watched directory (*) IN_OPEN File was opened (*) When monitoring a directory, the events marked with an asterisk (*) above can occur for files in the directory, in which case the name field in the returned event data identifies the name of the file within the directory. The IN_ALL_EVENTS symbol is defined as a bit mask of all of the above events. Two additional convenience symbols are IN_MOVE, which is a combination of IN_MOVED_FROM and IN_MOVED_TO, and IN_CLOSE which combines IN_CLOSE_WRITE and IN_CLOSE_NOWRITE. The following further symbols can be specified in the mask: IN_DONT_FOLLOW Don't dereference pathname if it is a symbolic link IN_ONESHOT Monitor pathname for only one event IN_ONLYDIR Only watch pathname if it is a directory Additionally, there is a symbol which doesn't appear in the inotify symbol set. It it IN_NO_LOOP. This symbol disables monitoring events until the current one is completely handled (until its child process exits). WILDCARDS
The following wildards may be used inside command specification: $$ dollar sign $@ watched filesystem path (see above) $# event-related file name $% event flags (textually) $& event flags (numerically) EXAMPLE
These are some example rules which can be used in an incrontab file: /tmp IN_ALL_EVENTS abcd $@/$# $% /usr/bin IN_ACCESS,IN_NO_LOOP abcd $# /home IN_CREATE /usr/local/bin/abcd $# /var/log 12 abcd $@/$# The first line monitors all events on the /tmp directory. When an event occurs it runs a application called 'abcd' with the full path of the file as the first arguments and the event flags as the second one. The second line monitors accesses (readings) on the /usr/bin directory. The application 'abcd' is run as a handler and the appropriate event watch is disabled until the program finishes. The file name (without the directory path) is passed in as an argument. The third example is used for monitoring the /home directory for newly create files or directories (it practically means an event is sent when a new user is added). This event is processed by a program specified by an absolute path. And the final line shows how to use numeric event mask instead of textual one. The value 12 is exactly the same as IN_ATTRIB,IN_CLOSE_WRITE. SEE ALSO
incrond(8), incrontab(1), incron.conf(5) AUTHOR
Lukas Jelinek <lukas@aiken.cz> (please report bugs to http://bts.aiken.cz or <bugs@aiken.cz>). COPYING
This program is free software. It can be used, redistributed and/or modified under the terms of the GNU General Public License, version 2. Lukas Jelinek 0.5.10 incrontab(5)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy