A string is a sequence of zero or more characters. It is commonly used to represent text or a sequence of bytes. Use this tag along with the appropriate programming language being used.

learn more… | top users | synonyms

28
votes
5answers
65k views

Formatting a comma-delimited CSV to force Excel to interpret value as a string

Searching around for a while trying to figure out how to format a CSV file in such a way to force Excel to interpret the values as a string and not try and convert them to numbers or dates. e.g... "...
15
votes
4answers
13k views

How do you escape apostrophe in single quoted string in bash?

I don't understand how bash evaluates escaping of apostrophe characters in single quoted strings. Here is an example: $ echo ''\''Hello World'\''' 'Hello World' # works $ echo '\'Hello World\'' &...
15
votes
4answers
123k views

Excel extract substring from string

I am looking for a way to extract a variable length substring from a string. My cells will look something like: ABC - DEF ABCDE - DEF ABCD - ABC I want to split the string at the - character, so ...
14
votes
3answers
80k views

Excel: Replace occurences of one character with another in a String?

I want an excel formula that will change Haverford, PA to haverford,+pa. (Text is to lowercase, and spaces are replaced with plus characters.) The following will get the first space, but not all of ...
13
votes
8answers
1k views

Bash Script to repeat every word in a line?

I have a string like: dog cat bird whale And I want to get dog dog cat cat bird bird whale whale All the words are in the same line. Any idea?
12
votes
3answers
52k views

Any Excel function that will reverse a string?

Are there any built-in Excel functions that will reverse a string?
10
votes
5answers
17k views

Excel CSV import treating quoted strings of numbers as numeric values, not strings

I've got a web application that is exporting its data to a CSV file. Here's one example row of the CSV file in question: 28,"65154",02/21/2013 00:00,"false","0316295","8316012,8315844","MALE" ...
6
votes
5answers
21k views

Excel Cell Length Limit

Excel is refusing to open some of the files I programmaticaly create. I think what is happening is that it pukes because a particular column has very long strings (up to 1850 chars), but for the ...
4
votes
4answers
5k views

What is a Linux command to find files containing some strings but not another?

I'm trying to search a lot of XML files for certain strings but not other strings, and I'm having trouble putting a command together to do it. I only want it to list the file names that match the ...
4
votes
2answers
974 views

concatenate cmd line starting from some parameter

If I get a cmd line like: myscript param1 param2 param3 param4 param5 param6 ... (so on) How can I save a string consisting of parameters starting from some specific one? The $@ gives me the whole ...
4
votes
3answers
5k views

How to use grep to match domain names?

I have a list of urls like: hxxp://url.com/subpage.html hxxp://www.url2.com/index.php hxxp://subdomain.url3.com/somepage.php ... How can I use grep to match the domain names only? All the urls ...
4
votes
1answer
27k views

Can I force an Excel 2010 Pivot-Table to display text strings from my raw data?

Here is my use-case. As a training specialist I want to look at a single tab in Excel and see student feedback at a glance. I want to see pie-charts showing who said "Yes" this course was a good use ...
3
votes
4answers
3k views

How to get the shortest string in a text file with shell

Assume I have a text file as below abcd aaaaaaa gfgk hahahahahahhahh gf Then gf would be returned.Any good ideas?
3
votes
3answers
3k views

Using vim to delete all lines except those that match an arbitrary set of strings

I use vim to remove all lines except those that match a particular string, e.g. :g!/[string that I want to remain in the editor]/d Works great. But what I really want, and haven't found anywhere, ...
3
votes
5answers
1k views

Convert string “1-5” into array of numbers in bash

What is the best approach to convert the string containing the range of numbers into numbers itself? This format is used for example in defining the range of pages to print. I define, I want to print ...
3
votes
2answers
444 views

sed in bash not working

I am trying to use the stream editor sed in bash to replace a string in a file to a new string that I entered, I have this thus far: echo "name to change" read updatenaamold echo "enter new name:" ...
3
votes
2answers
68 views

How can I how extract/parse variable info from the END of a string in Excel?

Example1: 01/28/14 Interest Earned 0.10 Example2: 12/27/13 CHECKCARD 1226 LIONHEART BOOKSTORE SEATTLE WA -25.13 In the two examples provided, my goal is to separate out the information ...
2
votes
3answers
2k views

Get LVM size using AWK?

I'm in need to find out the LVM size of image vm001. Let's say I have a LVM volume called /dev/VGgroup/vm001. Now using lvdisplay I can find out the size: --- Logical volume --- LV Name ...
2
votes
2answers
841 views

Find more than one string with Excel?

How to Find more than one string with Microsoft Office Excel? For example, I am looking for the cells which is contained both strings Paul and John? How to avoid to perform several finds by ...
2
votes
2answers
144 views

String replacement in Windows batch

I am trying to understand how string replacement in Windows batches actually works and having trouble. @echo off set var=wild set varnew=%var:l=n% echo var is: %var% echo varnew is: %varnew% does ...
2
votes
1answer
886 views

Formatting a tab-delimited CSV/TSV to force Excel to interpret value as a string

I had a followup question to this related post - Formatting a CSV to force Excel to interpret value as a string (not date or number) I was wondering how does one escape text starting with " using "...
2
votes
3answers
6k views

How can I extract sub-strings using windows command-line?

For example say I have a file called testfile.txt that contains a list of file names of the following format: A svn\New Text Document.txt M svn\Table_tblVersion.xml Is there a command ...
2
votes
3answers
1k views

Parse string using batch script

How can I parse string using batch script? Goal is to save in a array everything under Import: and strip out #head for example --> //MPackages/Project/config/abc.txt and //Packages/Project/config/cde....
2
votes
1answer
12k views

function keys for paste specific text

I want to assign some text to F keys on Windows 7. For example, I want to press F5 to paste "000", or press F6 to paste ".00 US Dollars". It would be appreciated if anyone can help me (a piece of ...
2
votes
3answers
38 views

How do I search for substrings in Bash?

I want to find out and display the total amount of TTT substrings found in the first 2,000 lines in the file. I had been using grep until I tested it, and realized it does not identify substrings.
2
votes
1answer
670 views

Excel VBA - User Defined Function to turn string into formula

I'm looking for something similar to the solution posted here: Excel function that evaluates a string as if it were a formula? Problem is this does not seem to work with a function in there. This ...
2
votes
2answers
831 views

how to make '' AND “” syntax highlight strings for python in notepad++?

Currently I have only "doubleQuotes" highlighted but the 'single ones' stay normal. Can someone confirm? Or have a solution how to fix that? In the stylers.xml there is WordsStyle named STRING which ...
2
votes
1answer
78 views

Notepad++ - Delete Everything Other Than The Specified Strings

I have the following strings that I want to keep and delete the rests: uicomp-type="example-string" uicomp-type='string-example' I use the following regex to find those strings: uicomp-type="(.*?)"|...
1
vote
2answers
116 views

A method to find two strings within distance

I have a large text file collection. I'm looking for a way to find two strings that are on the same line (in the same file) in the collection where the distance in characters between those two ...
1
vote
1answer
42 views

Concatenate strings

I would like to concatenate two columns of strings into one string in a separate column as follows. A B C CIK: 007924 CIK:007924 CIK: 009732 CIK:009732 but what ...
1
vote
2answers
699 views

How to search for any files that do not contain a proper XML root element?

I need to be able to search several thousand XHTML and XML files and see a list of files that do not contain the following string on the first line: <?xml version="1.0" encoding="utf-8"?> How ...
1
vote
2answers
105 views

How to split a string with quotes (like command arguments) in bash?

I have a string like this: "aString that may haveSpaces IN IT" bar foo "bamboo" "bam boo" I want to be able to split it like this: aString that may haveSpaces IN IT bar foo bamboo bam boo ...
1
vote
1answer
143 views

How To Search for multiple multi-word strings in vim?

For example I'm trying to search for the occurence of both hello world and goodbye world in the same line. I've tried a bunch of difference iterations. For example, if you want to find one multi-word ...
1
vote
3answers
60 views

Find first string in text string that is numbers only. Formulas only

Is it possible to find the first string within a string that contains only numbers/digits? I have a few thousand addresses to process and some of them have Apartment numbers. I need to find the ...
1
vote
1answer
212 views

How to Concatenate Repeating String in Batch Script

I'm trying to concatenate a repeating string depending on the first parameter value passed into the script when it is called. This value represents the number of directory levels the current ...
1
vote
1answer
2k views

how to search for a specific string in the body of lotus notes email

There are previous questions similar to this have been asked but never answered explicitly. Simply saving use search all documents with an indexed database is not a complete answer. How do you ...
1
vote
1answer
57 views

Converting strings in input file

I have a text file file1.txt on Unix. I'd like to produce another file file2.txt, in which I change all groups of lines that has this format (taken from a multiple-choice exam) a. [first choice] b. [...
1
vote
1answer
9 views

Removing and replacing the middle part of a string in bash

I've a few strings: Central and Western</td><td><a href="javascript:pop1('major-housing-estate/30006.html');" title="Kwun Lung Lau">Kwun Lung Lau Central and Western</td><...
1
vote
1answer
45 views

xrandr | grep “ connected ” give me more than one line but IFS=$'\n' read can't break it

I have something like this: declare -a DISPLAYS AUXILIAR="$(xrandr | grep " connected ")" IFS=$'\n' read -ra DISPLAYS <<< "$AUXILIAR" Why it isn't detecting line breaks if echo "$...
1
vote
1answer
1k views

A printer's SNMP community name is the default “public”, will changing it affect it's use?

I'd like to change it from the default "public" as a part of removing vulnerabilities in the workplace. Also, can the "read only", "read/write", and "trap" community names use the same strings?
1
vote
3answers
528 views

How can SHA512 make a long string into a short string

I´m wondering how this random and very long string €£$€@]}$€{[$£}]£[€€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f dfvt87t&R%...
1
vote
1answer
119 views

String variability generator: Forgotten password

There's a website that I changed my password on about 2 years ago, then quit. I know about 10 possibilities of what the password could be, and what I usually do is exchange a letter with a symbol, but ...
1
vote
1answer
558 views

Scrape a site with curl/wget appending a parameter to each site

I need to scrape a website for all sites and append an Paramater, e.g. www.theSite.com/allpages?myPara=us Now what I got is wget --recursive to get all sites, but that doesn't append the parameter ...
1
vote
1answer
579 views

Symbol which looks like . (dot) but is classified as letter in unicode

Iam writing my bachelor thesis at the moment. The problem for me is now the spellchecker (I use Open Office but this is a general problem) won't recognize .NET as a valid word. A also cannot add it to ...
1
vote
1answer
164 views

R: subset lines of a dataframe containing a string in another file

I would like to subset the lines of data frame 1 (df1) that contain a string from a column in data frame 2 (df2). The problem is that file1 will have multiple strings in the same column. I have tried ...
1
vote
2answers
84 views

How could I search a text file in Win7 and make it display matching lines

I have a large list of names that I have to search through many times a day. Using "find" in Notepad has gotten me by, but is there a way in the command line to display the matching strings by line ...
1
vote
1answer
327 views

Notepad++ macro for changing a certain part of a string

I want to define a Notepad++ macro that takes any string that contains "foo", and creates its new versions only changing the foo to "bar1", "bar2" etc. so if my file contains abc_foo_def when I ...
1
vote
1answer
171 views

Iptables: Filtering string encrypted by ssl

I need to filter (send to BANRULES set) incoming http/https packets with a certain string (matchword). I do it easy when ssl is not in use (port 80): iptables -A INPUT -p tcp -m tcp --dport 80 -m ...
1
vote
1answer
47 views

calc: Extract string from range of cells

I´m trying to figure out a easy to understand way to extract a string (that is in a range of cells) from a range of cells... That is the range of cells I have to look for a specific string (in a ...
1
vote
2answers
2k views

Is it possible to see if two cells contain similar text in Excel? [duplicate]

I've got two columns populated with names, and I want to see if the names in each row are similar (not the exact same, just similar) to each other. Is there any way to do this on Excel?