Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Data manipulation with cut command Post 302537362 by tukuyomi on Friday 8th of July 2011 01:43:34 AM
Old 07-08-2011
Try this:
Code:
~/unix.com$ echo 'some junk data xyz1@yahoo.com xyz2@yahoo.com some more junk data
some junk data HELLO ! some more junk data
some junk data HOW ARE YOU some more junk data' | awk '{print substr($0,16,length($0)-35)}'

As junk data has always the same length, you'll have to calculate the values 16 and 35
This User Gave Thanks to tukuyomi For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

data manipulation script

I have a folder called {homedata} Within this folder there are 12 subfolders 200601.......200612 Within each subfolder there are 8 sets of files Each filename commences with A B C D E F G or H, so {filename}* can be used. I am trying to write a script which will from the top level go... (1 Reply)
Discussion started by: grinder182533
1 Replies

2. Shell Programming and Scripting

Data manipulation with Awk

Hello guys, I'm a new member here and I need some help with the Awk application. I'm using it through the Terminal app of OSX (I'm a Mac user). I have a huge file with a large amount of data (rows of 3D cartesian coordinates). The data is typically like the following example (actually, the... (13 Replies)
Discussion started by: Cham
13 Replies

3. UNIX for Dummies Questions & Answers

Data Manipulation

Hello I am currently having problems in mapulating a certain file which contains vaious data. Belos is a sample content Event=<3190> Client IP=<151.111.11.143> DNS=<abc.sbc.com> TransCount=<139> Client IP=<150.222.133.163> DNS=<xyz.yuu.com> TransCount=<3734> Event=<3120> Client... (11 Replies)
Discussion started by: khestoi
11 Replies

4. Shell Programming and Scripting

Data manipulation from one file

HI all i have a file consisting of following numbers 0000 0000 0000 0000 0000 1010 0000 0100 0000 0000 0000 1111 0000 1010 0000 0100 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

5. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

6. UNIX for Dummies Questions & Answers

Data manipulation

Hallo Team, I need to manipulate existing data file. Have a look at current data and expected data: Current Data: 27873517141 27873540000 27873515109 27873517140 27873540001 27873540000 27873501343 27873540000 27873517140 27873511292 27873645989 27873540000 27873540000... (7 Replies)
Discussion started by: kekanap
7 Replies

7. UNIX for Dummies Questions & Answers

Data Manipulation

Dear Sir, I have file input RGR001|108.28|-2.86489|100-120|RANGGAR RGR002|108.071|-2.69028|80-100|RANNGAR RGR003|108.168|-2.97053|50-80|RANNGAR RGR007|108.192722222|-2.766138889|0-50|RANGGARI want to create files by joining each rows with each rows below Output as below ... (4 Replies)
Discussion started by: radius
4 Replies

8. Shell Programming and Scripting

Data manipulation, Please help..

Hello, I have a huge set of data that needs to be reformatted. Here is a simple example to explain the process. I have number n=5 and a input with many numbers separated with comma: ... (11 Replies)
Discussion started by: liuzhencc
11 Replies

9. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

10. Shell Programming and Scripting

Problem in extracting data using cut/awk command

Hi Everyone, I have a very simple problem and i am stuck in that from last 8 days. I tried many attempts, googled my query but all in vain. I have a text file named "test.txt" In that suppose i have contents like: Java: 1 Object oriented programming language 2 Concepts of Abstraction... (5 Replies)
Discussion started by: Abhijeet Anand
5 Replies
libnetlink(3)						     Library Functions Manual						     libnetlink(3)

NAME
libnetlink - A library for accessing the netlink service SYNOPSIS
#include <asm/types.h> #include <libnetlink.h> #include <linux/netlink.h> #include <linux/rtnetlink.h> int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions) int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type) int rtnl_send(struct rtnl_handle *rth, char *buf, int len) int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) int rtnl_dump_filter(struct rtnl_handle *rth, int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *), void *arg1, int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *), void *arg2) int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer, unsigned groups, struct nlmsghdr *answer, int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *), void *jarg) int rtnl_listen(struct rtnl_handle *rtnl, int (*handler)(struct sockaddr_nl *, struct rtnl_ctrl_data *, struct nlmsghdr *n, void *), void *jarg) int rtnl_from_file(FILE *rtnl, int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *), void *jarg) int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data) int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen) int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data) int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen) DESCRIPTION
libnetlink provides a higher level interface to rtnetlink(7). The read functions return 0 on success and a negative errno on failure. The send functions return the amount of data sent, or -1 on error. rtnl_open Open a rtnetlink socket and save the state into the rth handle. This handle is passed to all subsequent calls. subscriptions is a bitmap of the rtnetlink multicast groups the socket will be a member of. rtnl_wilddump_request Request a full dump of the type database for family addresses. type is a rtnetlink message type. rtnl_dump_request Request a full dump of the type data buffer into buf with maximum length of len. type is a rtnetlink message type. rtnl_dump_filter Receive netlink data after a request and filter it. The filter callback checks if the received message is wanted. It gets the source address of the message, the message itself and arg1 as arguments. 0 as return means that the filter passed, a negative value is returned by rtnl_dump_filter in case of error. NULL for filter means to not use a filter. junk is used to filter messages not destined to the local socket. Only one message bundle is received. If there is a message pending, this function does not block. rtnl_listen Receive netlink data after a request and pass it to handler. handler is a callback that gets the message source address, anscillary data, the message itself, and the jarg cookie as arguments. It will get called for all received messages. Only one message bundle is received. If there is a message pending this function does not block. rtnl_from_file Works like rtnl_listen, but reads a netlink message bundle from the file file and passes the messages to handler for parsing. The file should contain raw data as received from a rtnetlink socket. The following functions are useful to construct custom rtnetlink messages. For simple database dumping with filtering it is better to use the higher level functions above. See rtnetlink(3) and netlink(3) on how to generate a rtnetlink message. The following utility functions require a continuous buffer that already contains a netlink message header and a rtnetlink request. rtnl_send Send the rtnetlink message in buf of length len to handle rth. addattr32 Add a __u32 attribute of type type and with value data to netlink message n, which is part of a buffer of length maxlen. addattr_l Add a variable length attribute of type type and with value data and alen length to netlink message n, which is part of a buffer of length maxlen. data is copied. rta_addattr32 Initialize the rtnetlink attribute rta with a __u32 data value. rta_addattr32 Initialize the rtnetlink attribute rta with a variable length data value. BUGS
This library is meant for internal use, use libmnl for new programs. The functions sometimes use fprintf and exit when a fatal error occurs. This library should be named librtnetlink. AUTHORS
netlink/rtnetlink was designed and written by Alexey Kuznetsov. Andi Kleen wrote the man page. SEE ALSO
netlink(7), rtnetlink(7) /usr/include/linux/rtnetlink.h libnetlink(3)
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy