Finding a certain character in a filename and count the characters up to the certain character
Hello,
I do have folders containing having funny strings in their names and one space.
First, I do remove the funny strings and replace the space by an underscore.
Next step I need to do is storing only the characters up to the underscore in a variable. Problem: the number of characters preceding the underscore varies.
Something like:
By using
I'll get the total number of characters of the folder name. But how can I extract only the characters up to the underscore?
I want to make a script for change filename's character not in English for a given directory. But I am not sure where am I starting from due to I am a little bit new user for scripts.
At least is there anybody can help me to make first step ,how can I find illegal or unwanted characters in file... (5 Replies)
im having trouble doing this:
i have a variable with 2 characters repeating e.g. aababbbaaaababaabbaabbba
is there a way i can search the variable for a's and b's and then change a's to b's and b's to a's?
im guessing its like getting the 1's compliment of the string
im doing this in... (2 Replies)
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
Hi All,
I have a big log file i want to delete all characters (between 350th to 450th characters) starting at 350th character position to 450th character position.
please advice or sample code. (6 Replies)
I would like to display the last 8 characters of the filenames for filenames of different lengths.
I can delete the last 8 characters with sed but dont know how to only show the last 8 characters.
The filenames are something like;
afxH340800340000
afxH30800340021
afxR3080034002122
I... (3 Replies)
Hello,
I have a text file with n lines in the following format (9 column fields):
Example:
contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c
I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Hi All,
I have different type of file (.txt,.csv,.xml) format in my current directory. My requirement is that I need to remove the last character from the file format.
Example
count.txt$
csp_rules.csv^
Date.xml~
Need Output:
count.txt
csp_rules.csv
Date.xml
How to do that?.... (5 Replies)
Hello All,
I got a requirement when I was working with a file. Say the file has unloads of data from a table in the form
1|121|asda|434|thesi|2012|05|24|
1|343|unit|09|best|2012|11|5|
I was put into a scenario where I need the field count in all the lines in that file. It was simply... (6 Replies)
Hi All,
Special character ? is added in between filename. Am not able to figure our why this is happening. In my Development environment special characters are not present. This issue is happening in the higher environment.
It would be helpful if somebody can tell what are the possible... (3 Replies)
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT DEBIAN
xtokid
XTOKID(1) User Commands XTOKID(1)NAME
xtokid - Print all tokens found in a source file
SYNOPSIS
xtokid [OPTION]... [FILE]...
DESCRIPTION
Print all tokens found in a source file.
-i, --include=LANGS
include languages in LANGS (default: "C C++ asm")
-x, --exclude=LANGS
exclude languages in LANGS
-l, --lang-option=L:OPT pass OPT as a default for language L (see below)
-m, --lang-map=MAPFILE
use MAPFILE to map file names onto source language
-d, --default-lang=LANG
make LANG the default source language
-p, --prune=NAMES
exclude the named files and/or directories
--files0-from=F
tokenize only the files specified by NUL-terminated names in file F
--help display this help and exit --version output version information and exit
The following arguments apply to the language-specific scanners:
C language:
-k,--keep=CHARS
Allow CHARS in single-token strings, keep the result
-i,--ignore=CHARS
Allow CHARS in single-token strings, toss the result
-u,--strip-underscore
Strip a leading underscore from single-token strings
C++ language:
-k,--keep=CHARS
Allow CHARS in single-token strings, keep the result
-i,--ignore=CHARS
Allow CHARS in single-token strings, toss the result
-u,--strip-underscore
Strip a leading underscore from single-token strings
Java language:
-k,--keep=CHARS
Allow CHARS in single-token strings, keep the result
-i,--ignore=CHARS
Allow CHARS in single-token strings, toss the result
-u,--strip-underscore
Strip a leading underscore from single-token strings
Assembly language:
-c,--comment=CHARS
Any of CHARS starts a comment until end-of-line
-k,--keep=CHARS
Allow CHARS in tokens, and keep the result
-i,--ignore=CHARS
Allow CHARS in tokens, and toss the result
-u,--strip-underscore
Strip a leading underscore from tokens
-n,--no-cpp
Don't handle C pre-processor directives
Text language:
-i,--include=CHAR-CLASS
Treat characters of CHAR-CLASS as token constituents
-x,--exclude=CHAR-CLASS
Treat characters of CHAR-CLASS as token delimiters
Perl language:
-i,--include=CHAR-CLASS
Treat characters of CHAR-CLASS as token constituents
-x,--exclude=CHAR-CLASS
Treat characters of CHAR-CLASS as token delimiters
-d,--dtags
Include documentation tags
Lisp language:
REPORTING BUGS
Report bugs to bug-idutils@gnu.org
xtokid - 4.5 August 2012 XTOKID(1)