Sponsored Content
Full Discussion: Seperate file content
Top Forums Shell Programming and Scripting Seperate file content Post 302379188 by ghostdog74 on Wednesday 9th of December 2009 09:39:19 PM
Old 12-09-2009
Code:
while read -r a b
do
 fileindex="$a"
 filepath="$b"
done <"file"

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

look in file, seperate letters, put in order...

okay, I need some help! Im trying to write a script where it looks in the file you designate, pulls apart all the words so i can count how many of each letter there is in the file, then i need to put them in the order of the most occuring letter to the least. This most likley will need a loop... (3 Replies)
Discussion started by: chekeitout
3 Replies

2. Shell Programming and Scripting

Split File into seperate files

Hi, So I have a text file which I want to separate into separate text files. I would use the split command but the problem here is that the text file is separated by delimiters. For example: blah blah blah ------ more text ----- and some more text So basically the first part should be... (4 Replies)
Discussion started by: eltinator
4 Replies

3. Shell Programming and Scripting

seperate elements of a file

i want to write a script in Bash Shell that accept a list of files.an example of file is 4334:234 322.345:32 234:3452 e.t.c each file only contain lines like num1:num2 i want to count the lines of this file and find the summary of X=4334+322.345+234 and Y=234+32+3452 (1 Reply)
Discussion started by: nektarios4u
1 Replies

4. UNIX for Dummies Questions & Answers

Seperate contents in a file with | as delimiter

Hi, I do have a file with follwoing as contents: 816|817118| 816|933370| 816|1215241| I want to store the above values into two arrays as follows: arr1 = { 816,816,816} arr2 = {817118,933370,1215241} How it can be achieved ? (5 Replies)
Discussion started by: risshanth
5 Replies

5. UNIX for Dummies Questions & Answers

Script for parsing details in a log file to a seperate file

Hi Experts, Im a new bee for scripting, I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
Discussion started by: pingnagan
2 Replies

6. Shell Programming and Scripting

Set lines of in a file to seperate vars

In a bash script, I'm looking for a way to set each matching line of a file into its own variable, or variable array. As an example, i have a crontab file with several entries: 00 23 * * * /usr/local/bin/msqlupdate -all 00 11 * * * /usr/local/bin/msqlupdate -inc 00 03 * * *... (2 Replies)
Discussion started by: lochraven
2 Replies

7. UNIX for Dummies Questions & Answers

looping through file and creating seperate files

Hi, My first post!! I have a files with header, something like this Header_Row AMC|D1|D2|D2 AAO|D3|D4|D5 AMC|D6|D7|D8 AAO|D9|D10|D11 . . . . . and millions fo records thereafter like this. I want to read the above file in a loop and write the lines having AMC into another... (1 Reply)
Discussion started by: amitbakre
1 Replies

8. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

Seperate Odd and Even numbers from 1 file to 2 files

Hey guys. I have been trying to figure out an easy way to seperate a liste of 150k numbers (10 digits) in a .txt file into odd and even numbers with each of their own files, for a project at work. I've tried Excel, but it was too much for it and it wasnt very simple. So i gave up after... (13 Replies)
Discussion started by: TranceC
13 Replies

10. Shell Programming and Scripting

Extract columns into seperate file

I have a comma delimited file as per the one below and I am currently extracting the values in 2 columns (COL1 & COL6) to produce a smaller trimmed down version of the file which only contains the columns we need; COL1,COL2,COL3,COL4,COL5,COL6,COL7,COL8,COL9... (1 Reply)
Discussion started by: Ads89
1 Replies
DtDtsDataToDataType(library call)										 DtDtsDataToDataType(library call)

NAME
DtDtsDataToDataType -- get the data type for a set of data SYNOPSIS
#include <Dt/Dts.h> char *DtDtsDataToDataType( const char *filepath, const void *buffer, const int size, const struct stat *stat_buff, const char *link_path, const struct stat *link_stat_buff, const char *opt_name); DESCRIPTION
The DtDtsDataToDataType function determines the data type of a set of data, based on the information given in the non- NULL pointer argu- ments to the function. The function gathers any additional information, if it is needed, to compensate for the NULL arguments. For exam- ple, if the filepath argument is given, but the stat_buff argument is NULL and a stat_buff value is required to determine the data type, DtDtsDataToDataType calls the stat(2) function to obtain the information. The filepath argument is the pathname of a file. The buffer argument is a pointer to the buffer of the data to be typed. The size argument is the size of the buffer in bytes. The stat_buff argument is the buffer returned from a stat(2) or fstat(3) call for use in typing. The link_path argument is the pathname of the target file pointed to by a symbolic link. The link_stat_buff argument is the buffer returned from an lstat(2) call for use in typing. The opt_name argument can be used to specify a name to be associated with the buffer. If the opt_name argument is not NULL, it is used as a pseudo file name in typing; otherwise, certain attributes may be returned as NULL because the filename components could not be deter- mined. RETURN VALUE
Upon successful completion, the DtDtsDataToDataType function returns a pointer to a data type string, or NULL if no value could be deter- mined. APPLICATION USAGE
The DtDtsDataToDataType function is generally used by applications such as file managers to improve performance. Typical applications should probably use DtDtsFileToDataType(3) or DtDtsBufferToDataType(3) instead. The DtDtsBuffer* functions assume that the buffer is readable and writable by the user, group and other file classes and select a type accordingly. An application requiring a type based on read-only permissions should use DtDtsDataToDataType with a stat_buff value created for this purpose: all fields should NULL except for the st_mode field, which should be set to: S_IFREG | S_IROTH | S_IRGRP | S_IRUSR SEE ALSO
Dt/Dts.h, DtDtsLoadDataTypes(3), DtDtsFileToDataType(3), DtDtsBufferToDataType(3), fstat(3), lstat(2), stat(2). DtDtsDataToDataType(library call)
All times are GMT -4. The time now is 06:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy