Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [string]

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.

0
votes
0answers
18 views

Regex to match String inside Parentheses (Javascript) [migrated]

I been struggling to find a Regex that help me match 3 different strings only if they aren't inside parentheses, but so far I have only managed to match it if it's right next to the parentheses, and ...
0
votes
0answers
4 views

String parsing and getting array index from a text string [migrated]

I parse a nested Json file which had nested objects and array and got the result in Map(String, Object). Result that I am able to get: RoomStays.RoomStay.RoomRates.RoomRate[15].Rates.Rate[0].Base....
2
votes
1answer
258 views

Wrong string concatenation using Bash Windows Subsystem

I'm having headaches to know why my script doesn't work as expected under windows subsystem linux. My version from the store : Debian GNU/Linux 9.6 (stretch) (I tried ubuntu too, with the same ...
2
votes
1answer
97 views

Find position of first uppercase character in excel string

I need to find the position of the first uppercase character in an Excel string. There are lots of resources on the web that have the same (or effectively the same) solution for this: =MIN(IF(ISERROR(...
1
vote
3answers
44 views

Extract and SUM numbers from a string

I have looked at the similar questions to this but could not find an exact solution to my problem. If there is a duplicate which can solve this I will close this question. In cell A1 I could have a ...
0
votes
1answer
27 views

Cut 4 digits from AD DisplayName

I have googled and used the PS help as much as possible but can't find a definitive resolution to the seemingly small issues that I have. My users have [ZZ] at the end of their displayName of their ...
0
votes
1answer
75 views

Extracting SharePoint data on daily basis

I want to export my SharePoint document library data on daily basis and csv file need to be save as naming convention as Dataname_yyyyMMdd. As per my below script, it need to export data from the ...
0
votes
2answers
49 views

Extract Text from in front of, after, and inside characters

I have a variable (%~1) set to something like: Hello there this is a block: [C]Inside of Block[/C] Did you like it? I want to have it separated into three variables: Front=hello there this is a ...
0
votes
1answer
69 views

extract data from SharePoint document library to CSV using powershell

I am trying extract data of SharePoint document library to CSV file using powershell. I am getting data correct on CSv file. But one column i.e "Description" have more text data on it.So when run the ...
0
votes
1answer
101 views

Hashtags are coming when export data to CSV file by powershell script

I am running a powershell script for getting data from SharePoint document library. While run the script, data came to csv file, but columns names are coming with ";#" hashtags. For example, names, ...
0
votes
1answer
42 views

Equivalent of a wildcard in find for batch?

I'm almost certain this is a duplicate but I was unable to find it after a lot of searching so forgive me. I'm looking for a way to have the equivalent of a wildcard in the find command. For ...
1
vote
1answer
28 views

How to extract multiple urls from String?

I have a string like below https://website.com/BTAE/2015/BTAE assignment jan 15.pdf²0ÔË'\„QI„"ÙP¾^ŒŸZ‡@Æ*]Ü.^‚vðƒ€Ù¾»Æš©Šñ‘€é• ªÂIR#œÉgÉÛ^gMdÉ%9¬e˜Hžôb¿'0<ô ?lþzk…éÃÄórÈ;EW¦K³1…²ì¶ZFžŠÒô*ÄÖ\...
1
vote
1answer
60 views

Find the part of the string that distinguishes a string in one cell from a string in another cell

I have two columns with strings and want to know which parts of the string from one column has with the other column. I have checked this solution Compare 2 text cells and show difference in the third ...
1
vote
2answers
31 views

When to use \ in grep search string

I have file content similar to: A+B C+D A+B These are strings. I want to search for the occurrence of A+B. So I write the command as: grep 'A+B' test.txt. However, if I write grep 'A\+B' test.txt I ...
0
votes
1answer
102 views

Logical AND and OR with grep

I want to extract the lines that matches the following logical operation: "AB+CD" AND ("nonAB+nonCD" OR "nonAB+CD"). Which means I want lines with: AB+CD,nonAB+nonCD AB+CD,nonAB+CD AB+CD,nonAB+...
0
votes
1answer
194 views

How to compare two columns of two different files

I have two file.The first one contains something like: a.com,5,some,text b.com,10,some,text c.com,5,some,text d.com,12,some,text e.com,5,some,text c.com,5,some,text The second contains something ...
0
votes
2answers
713 views

How to start searching from second column using grep command

I have a file contains string like the following: site1.com,Level1.2 site2.com,Level1.1,Level1.0,Level1.2 site3.com,Level1.2 site4.com,Level1.2,Level1.1,Level1.0,Levelv3 siteLevel1.2,Levelv2 Level1.2,...
0
votes
1answer
73 views

How would I pipe a command to grep to search for a certain string, when part of that string is unknown?

The program I am working on makes use of grep to search a system log for a particular alert, however the an element of the syslog entry I am looking for will pertain specifically to that entry, and ...
1
vote
2answers
290 views

Count occurrences of a string in a cell

I have an Excel file containing a piece of HTML code in a cell: <li>item 1</li><li>item 2</li><li>item 3</li> Now I want to count the occurrences of the string "&...
0
votes
1answer
46 views

Batch script to fetch each line from a .txt file as a string (more than one word in a line) and google search each string in a separate tab in chrome

I've a controlfile.txt file in which I have some softwares names in each line, e.g. "Microsoft Office" in first line, then "Autodesk AutoCAD" in second line, "Adobe Acrobat Reader" in third line and ...
0
votes
0answers
32 views

Adding numbers in some cells of a table

Given an ASCII text file on a generic Unix/Linux system that looks like: | 0.9 | 0.6 | 8+1 | ... ... How can I replace the expressions with their values, for example, replace 8+1 with 9? ...
0
votes
2answers
582 views

How to parse multi-line log file in awk and output only single line with last known ip address

I am stuck and looking for assistance. I want to trigger an event which I'd like to process further through a bash script. The data is retrieved from a log file. Before I start to explain I'll show ...
0
votes
2answers
43 views

How to convert a string of comma-separated values into an array

I have a several cells with strings such as this one: "John,Carla,Peter,John,Bob,Chris,Carla,Andrea" I would like to count how many different people are named (i.e. how many unique values). The ...
0
votes
2answers
648 views

How to trim text before specifc character using notepad++

I have a file each line look like "J001.C1086" "JH001.Blend 10-111". I need to remove the leter/number before each . after remove, it look like "C1086" "Blend 10-111" Thanks!!
4
votes
1answer
104 views

How do I properly escape '=' in my string replacement script?

I have made a batch script that replaces strings in a specified text-based file. Within my file, the string OutDir=bin should be replaced as OutDir=Build but gets output as bin=OutDir=Build=bin. How ...
3
votes
2answers
7k views

Insert quote into string variable in bash

Is there way of inserting a quote at the start and end into a string variable? I have this variable say: string="desktop/first folder" If I echo this, it will display: desktop/first folder I need ...
3
votes
1answer
24 views

Excel: How to assign value to txt and sum

I have a file with several football player ratings: ***, **, * or x. *** means a performance of 3, **= 2; *= 1 and x if the player didn't play. I want to have a sum at the end of the row to see the ...
0
votes
2answers
741 views

curl: add string as option in bash

I'd like to pass a variable string to command options in curl. if [ ! -z ${picture} ]; then APISTRING+="--data-urlencode \"picture=${picture}\" ";fi if [ ! -z ${additional} ]; then APISTRING+="--data-...
0
votes
0answers
134 views

What do the following Windows Registry string values mean?

While editing the Registry, in particular to tweak Windows Explorer's right-click/context menu, I've come across the following values: NoWorkingDirectory OnlyInBrowserWindow LaunchExplorerFlags ...
0
votes
1answer
90 views

How to match a substring from a cell from an array list in EXCEL

I'm trying to get a "Date" from the following column containing these values: MODIFICATIONAUG16 NEWSEP16 RENEWALAUG 17 RENEWALAUG10 RENEWALAUG17 I want to extract the date part of these strings to ...
0
votes
1answer
211 views

Parse RegEx in Excel

Suppose I have some Excel spreadsheet with the following column: A-345 hello hola B-389 nice C-6231 what A-12287 who just A-7819 C-45556 As you can see - I have a text combined ...
1
vote
1answer
5k views

How to replace character “-” by “%_%” in a batch file?

set var=this-is-a-test ECHO I would like to convert the value of this variable to "this%_%is%_%a%_%test" I tried with: SET VAR=%VAR:-=%_%% But doesn't work :( Please help
1
vote
1answer
942 views

Can't concatenate a string inside a batch loop

I've been struggling with this for a while now, and I can't seem to figure out why. I have this batch file: @echo on setlocal enabledelayedexpansion for /F %%x in (FileList.txt) do ( for /L ...
2
votes
2answers
48 views

Scan first 512 bytes for strings with gnu strings command

I'm trying to use the GNU strings tool for a clean way to get all strings more then 5 chars in a compiled file but only in the first 512 bytes. strings compiledfile -n 5 With the above command you ...
1
vote
1answer
36 views

Separating keywords from a line of text in batch

I'm admittedly new to using batch commands so i'm not sure if this is at all possible, if it isn't please let me know. Recently I made a simple batch command to list the directories of all files ...
2
votes
1answer
244 views

Why doesn't command substitution work inside `find`?

In bash, if try to run the function basename within the -exec option of find, it doesn't seem to do anything. As an example: find . -name "*pdf" -exec echo $(basename {}) \; yields the filename ...
0
votes
2answers
57 views

How do I combine String with each comma separated value from another Cell

I am working with a list of account numbers in column A and list of subs in column B. Column A has just the account number for example: 310050. Column B has a list of subs: Example: 10,11,30. What I ...
0
votes
2answers
25 views

I need to extract a 8 characters between known and copy value to clipboard

I am not a superuser but more of a supertinkerer. I would like to take a text file, a CNC program to be exact, and extract an 8 digit string from between the known characters of "TxxxxxxxxM6" where T ...
1
vote
2answers
165 views

Batch File add Extension to String

I am new here and to batch scripting, trying to learn. I have a batch that adds an extension to each string in a text file but what I have right now, it leaves a space before the extension. @echo ...
1
vote
1answer
687 views

Is there a Regular Expression to find characters in sequence?

I've searched high and low, and cannot seem to find anything, so finally deciding to beg for help here in the hopes anyone here can give me a hint! My current task is to search a list of strings, for ...
0
votes
1answer
256 views

Case sensitive filter, or helper column formula that also accepts wildcards

Say I have a list containing the strings ABC123 abc123x3 Abc123x4 ABC123x5 I want to filter the list to contain anything containing *c1*x* where * represents any number of characters. i.e. I ...
1
vote
1answer
337 views

Selecting lines in PowerShell script

I have code: $dir=(new-object Net.WebClient).DownloadString("http://www.nbp.pl/kursy/xml/dir.txt") $dir | foreach { if ($_.startswith("a")) { write-host $_ } } and I need to ...
1
vote
1answer
1k views

Batch – Delete Characters in a String

For example, I have the following path: "C:\Windows\Example\001 Example\005 Example" I must extract the "005 Example" from this string. I've tried it with "set path=%path:~0,11%", but the path can ...
0
votes
1answer
58 views

pad string with spaces

I cannot figure out how to add spaces before or after a string, and then store the padded string in a variable. Printing to console works fine, but when I try to assign the result of the printf to a ...
2
votes
2answers
4k views

How to echo the variable's value containing percent signs? [duplicate]

I want to echo a variable with the %'s. Ex: set var=Hello echo %var% That would obviously result in echoing "Hello", but how can I get it to just echo %var%?
1
vote
3answers
96 views

How to prefix the first 3 lines of a file with different variables?

So I have to go through a log I am emailed (in windows), search for a line to determine the models serial number, I figured an easy way to do that was to write up an ugly batch script to convert the ....
3
votes
1answer
4k views

Use findstr to Search a Sub Directory for a String?

I can use the following to search for text files that contain the word "string" from the Windows Command Prompt: C:\>findstr /spin /c:"string" *.txt What if I want to search a sub-directory? The ...
1
vote
1answer
181 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><...
0
votes
0answers
276 views

MS Word Macro to change string to Numbers in long documents?

I am as beginner as it gets with VBA and macro. I am looking to record a macro for MS Word documents that converts string to number. For example the document will have like (one thousand and four) or (...
3
votes
2answers
142 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.