Dear All,
I have a comma-separated file.
1. The first line of the file(header) should have 4 commas(5 fields).
2. The last line of the file should have 1 comma(2 fields).
Pls help me in checking this condition in a shell script.
And the number of lines between the first line and last... (11 Replies)
I have a csv file with lines like the followings
123456,"ABC CO., LTD","XXX"
789012,"DEF LIMITED", "XXX"
before I bcp this file to database, the comma in "CO.," need to be removed first.
My script is cat <filename> | sed 's/"CO.,"/"CO."/g'
but it doesn't work. Can anyone here able to... (2 Replies)
I have a situation where I am reading a text file line-by-line. Those lines of data contain comma separated fields of data. However, each line can vary in the number of fields it can contain. What I need to do is parse apart each line and write each field of data found (left to right) into a file.... (7 Replies)
Hi Friends,
I'm working on a perl script, which seems to be simpler. But I'm very new to PERL scripting.
I have a comma separated data file, from which I need to extract only the seventh field data out of available twenty fields to an array using perl.
Any help would be much appreciated.
... (17 Replies)
Guys,
Need you help, i have a a file content that look like this.
Nokia 3330 <spaces><spaces><more spaces>+76451883874
Nokia 3610 +87467361615
so on and so forth,
- there are so many spaces in between.
- e.g.... (5 Replies)
I have a list of files with the same name, but they have a different date stamp in the name. I can find the first file, but I need to find the second file. I am using this information to create a variable I use later. Here is a example of how I find the first file.
"ls -mr... (11 Replies)
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
I need to arrange output of SQL query into a comma separated format and I'm struggling with processing the output...
The output is something like this:
<Attribute1 name><x amount of white spaces><Atribute value>
<Attribute2 name><x amount of white spaces><Atribute value>
<Attribute3... (2 Replies)
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields.
Sample lines from the .csv file:
Device Name,Personnel,Date,Solution... (1 Reply)
Discussion started by: jxrst
1 Replies
LEARN ABOUT NETBSD
flags_to_string
STAT_FLAGS(3) BSD Library Functions Manual STAT_FLAGS(3)NAME
string_to_flags, flags_to_string -- Stat flags parsing and printing functions
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <util.h>
char *
flags_to_string(u_long flags, const char *def);
int
string_to_flags(char **stringp, u_long *setp, u_long clrp);
DESCRIPTION
The flags_to_string() and string_to_flags() functions are used by programs such as ls(1), mtree(8), makefs(8), etc., to parse and/or print
the st_flags field in the stat(2) structure.
They recognize the following flags:
String Flag Description
arch SF_ARCHIVED file is archived
nodump UF_NODUMP do not dump file
opaque UF_OPAQUE directory is opaque in union filesystems
sappnd SF_APPEND writes to the file may only append
schg SF_IMMUTABLE file cannot be changed; it is immutable
snap SF_SNAPSHOT file is a snapshot inode
uappnd UF_APPEND writes to the file may only append
uchg UF_IMMUTABLE file cannot be changed; it is immutable
The SF_APPEND and SF_IMMUTABLE flags are for the superuser only, whereas UF_APPEND and UF_IMMUTABLE are for the user only.
The flags_to_string() function converts the bits set in the flags argument to a comma-separated string and returns it. If no flags are set,
then the def string is returned. The returned string is allocated via malloc(3) and it is the responsibility of the caller to free(3) it.
The string_to_flags() function takes a stringp of space, comma, or tab separated flag names and places their bit value on the setp argument.
If the flag name is prefixed by: ``no'', then the bit value is placed on the clrp argument.
RETURN VALUES
flags_to_string() returns the symbolic representation of flags, the default string, or NULL if allocation failed.
string_to_flags() returns 0 on success and 1 if it fails to parse the string, setting stringp to point to the first string that it failed to
parse.
SEE ALSO chflags(2), stat(2)BSD August 6, 2011 BSD