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

19
votes
5answers
41k 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... ...
14
votes
4answers
9k 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\'' ...
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?
13
votes
3answers
75k 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 ...
7
votes
3answers
35k views

Any Excel function that will reverse a string?

Are there any built-in Excel functions that will reverse a string?
5
votes
5answers
16k 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
62k 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 ...
4
votes
4answers
4k 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
844 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
4k 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 ...
3
votes
4answers
2k 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
1k 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
3answers
8k 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" ...
3
votes
5answers
886 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
1answer
16k 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 ...
2
votes
2answers
324 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:" ...
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
821 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
3answers
82 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 ...
2
votes
1answer
8k 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
1answer
756 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
1answer
403 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
561 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
49 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: ...
1
vote
2answers
112 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
2answers
55 views

Replacing several strings in a file in one go

Suppose I want to replace all AAA with BBB and all BBB with AAA in a text file. The thing which looks an obvious solution (in Perl or in Sed) is: s/AAA/BBB/g; s/BBB/AAA/g; But this does not ...
1
vote
1answer
73 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
1answer
75 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
1k 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
51 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
2answers
401 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
3answers
5k 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 ...
1
vote
1answer
25 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
393 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
234 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 ...
1
vote
1answer
107 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
519 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
440 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
2answers
30 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
134 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
72 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
33 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
342 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?
1
vote
1answer
359 views

Search, copy, paste, edit string in hex?

I'm using Windows 7 64-bit. I've got around 10,000 or so files that I want to edit. The trouble is that's just far too much to do by hand. I'll explain what I need to do below. In these files, there ...
1
vote
0answers
161 views

GPU used for String operations ?

Am working a bit on CUDA, most of the examples and tutorials i see deal with implementing mathematical functions on the GPU ( Like some vector / matrix calculations). I was wondering if we can ...
1
vote
1answer
199 views

Batch : extract some characters of a string

How can I extract alphanumeric characters only from a string? Example : b:lbalbqsd1287/;:!, gives blbalbqsd1287 Is it possible with findstr?
1
vote
1answer
458 views

Protocol URL in Firefox doesn't work if it contains “%2F”

If I write something like the following into the navigation bar of Mozilla Firefox, nothing happens: ...
1
vote
1answer
370 views

notepad++ to search a line for varied strings. advanced commands

here it is ab12@zmial.com, Charles Dawson cd21@zmial.com, ef23@zmial.com, gh32@zmial.com, ij34@zmial.com, mn45@zmial.com, op54@zmial.com, Queen Roffman qr56@zmial.com, kl43@zmial.com, ...
1
vote
3answers
693 views

Microsoft SQL. SELECT FROM WHERE query with varchar type column

Inside the SQL Server Management Studio I am trying a query like this: In human words: Give me all rows from the table where the string in the column "name" is "alice". My not working attempt on ...
0
votes
2answers
473 views

Search recursively for a string containing whitespaces

I want to search for "this table..." string under /home/myuser directory recursively, ie in all files under /home/myuser and in all directories and sub-directories under /home/myuser. /home/myuser ...