Hi,
I need to put the single line contents of a file into a variable, but remove the last character, for example the file would have this sort of contents:
2;4;3;10;67;54;96;
And I want the variable to be:
2;4;3;10;67;54;96 (notice the last ";" has gone).
Unfortunately I can't just... (4 Replies)
I've been looking on the internet, and haven't found anything simple enough to use in my code. All I want to do is count how many times "-" occurs in a string of characters (as a package name). It seems it should be very simple, and shouldn't require more than one line to accomplish.
And this is... (2 Replies)
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
Hi,
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file (8 Replies)
Hi,
I have a file with lines such as the below. I want to remove the comma only if it is the first character on a line. I can't work out how to do this using sed.
*ELSET, ELSET=WHEEL_TD2
63, 64, 65, 72, 82, 88, 89, 92, 120, 121, 152, 181, 190, 221, 252, 259
, 260, 282, 283, 285, 286,... (2 Replies)
Hi guys,
Does anyone know how to remove the last character in each of the line?
This is what I have:
ABCDE.1
GLSJD.2
HIJPL.2
HKAGB.3
IUBWQ.1
What I want (remove the dot and number):
ABCDE
GLSJD
HIJPL
HKAGB
IUBWQ
I tried to use this: sed 's/.*//'
But I'm not sure if that is... (3 Replies)
Hi,
I am trying to remove multi line and single line comments like examples below
I have tried this pattern. it works fine for single line comments and multi line comments in a single line only. but this fails when the comments are extended in multiple lines as shown in the comment 2 of... (3 Replies)
Regarding copy/pasted text of copyright-free book from archive.org (link below), in attempt to expand single-line-break paragraph text (not section headings or paragraph breaks) to wider right margin, Justify or Wrap in LIbreOffice is not working, and Find/Replace the paragraph mark ($) wraps all... (2 Replies)
Hi All,
So I have to remove all the @hostnames from a file, the problem is, there are instances where @ is used for other things... For example:
example text:
@This is some text in between some at signs@
@This is some more text@
This is a line that will contain a username and his/her... (5 Replies)
Discussion started by: joeg1484
5 Replies
LEARN ABOUT DEBIAN
guards
GUARDS(1) User Contributed Perl Documentation GUARDS(1)NAME
guards - select from a list of files guarded by conditions
SYNOPSIS
guards [--prefix=dir] [--path=dir2:dir2:...] [--default=0|1] [-v|--invert-match] [--list|--check] [--config=file] symbol ...
DESCRIPTION
The script reads a configuration file that may contain so-called guards, file names, and comments, and writes those file names that satisfy
all guards to standard output. The script takes a list of symbols as its arguments. Each line in the configuration file is processed
separately. Lines may start with a number of guards. The following guards are defined:
+xxx Include the file(s) on this line if the symbol xxx is defined.
-xxx Exclude the file(s) on this line if the symbol xxx is defined.
+!xxx Include the file(s) on this line if the symbol xxx is not defined.
-!xxx Exclude the file(s) on this line if the symbol xxx is not defined.
- Exclude this file. Used to avoid spurious --check messages.
The guards are processed left to right. The last guard that matches determines if the file is included. If no guard is specified, the
--default setting determines if the file is included.
If no configuration file is specified, the script reads from standard input.
The --check option is used to compare the specification file against the file system. If files are referenced in the specification that do
not exist, or if files are not enlisted in the specification file warnings are printed. The --path option can be used to specify which
directory or directories to scan. Multiple directories are separated by a colon (":") character. The --prefix option specifies the
location of the files.
AUTHOR
Andreas Gruenbacher <agruen@suse.de> (SuSE Linux AG)
perl v5.14.2 2012-03-04 GUARDS(1)