Questions tagged [getcontent]
23 questions
17
votes
4 answers
Android ActivityResult API unresolved reference error registerForActivityResult
I am trying to use ActivityResult APIs as stated here ActivityResult APIs
But it is giving unresolved reference error.
I am using following dependencies
api 'androidx.activity:activity:1.1.0'
api 'androidx.activity:activity-ktx:1.1.0'
api…

Krishna Meena
- 5,693
- 5
- 32
- 44
3
votes
1 answer
How to replace only a portion of string using PowerShell Get-Content -replace
I have a file in which I need to modify a URL, not knowing what that URL contains, just like in the following example:
In file file.txt I have to replace the URL, so that wether it is "https://SomeDomain/Release/SomeText" or…

Mihnea Cristian Marin
- 135
- 2
- 11
2
votes
1 answer
Powershell: How to output a table to a log file
I am trying to create a script for my job and I need to read a xml file to check if there are any duplicated parameter.
So far I can output the table but I haven't been able to export as any kind of file (log, csv, etc)
The idea is to run the script…

Brazs
- 35
- 5
2
votes
2 answers
PowerShell find and replace using an array of strings
I'm wanting to comb through an LDIF file for 28 strings to replace. I have two arrays, one for the find, and another for the replace items.
The replace is working, but is then overwritten on the next iteration. I don't know how to keep the existing…

FP55
- 89
- 1
- 5
2
votes
1 answer
How to add conditions from a variable on Powershell?
I would like to add an input variable that would allow me to add as many conditions as I want.
Ex : A variable for add -and ($_ -notmatch '67'
$file = "\Input\27532.csv"
$outFile = "\Output\27532.csv"
$content= Get-Content $file | Where-Object {…

Songo
- 23
- 3
2
votes
0 answers
Powershell Get-Content file not found after Get-ChildItem
I am currently trying to read the metadata from an index server export with PowerShell to be able to tag a SharePoint document library with this information.
First I search all XML files in the current directory:
$XMLPaths = Get-ChildItem -Recurse…

heim0r
- 21
- 1
1
vote
1 answer
WooCommerce endpoints content
How can I get the endpoint's contents of my-account page in WooCommerce? for example: i want to show the content for each endpoints in custom tabs the below code just give me the endpoints and slug. is there ways to get contents too?

Behzad
- 75
- 1
- 7
1
vote
1 answer
Where-Object Error When Passing Get-Content as Variable
First, my PS knowledge is very basic, so know that up front.
I'm working on a basic script to search EventIDs in archived .evtx files and kick out "reports". The Where-Object queries are in .txt files stored in .\AuditEvents\ folder. I'm trying to…

nomen
- 13
- 3
1
vote
2 answers
android 9 get content from clipboard programmatically
I have a project for share clipboard content between phone and desktop service.
When I try getText from clipboard it return empty string. It worked previously for a few months on a Android Pie.
ClipboardManager clipboard = (ClipboardManager)…

Papp Zoltán
- 131
- 7
1
vote
1 answer
How to limit ActivityResultContract.GetContent to media (image or video)
Is there a way to make ActivityResultContract.GetContent filter only media files?
private val selectMediaResultLauncher = registerForActivityResult(ActivityResultContracts.GetContent()) { uri: Uri? ->
// Do something with the uri
}
Tried to…

Udi Oshi
- 6,787
- 7
- 47
- 65
1
vote
2 answers
PowerShell Extract text between two strings with -Tail and -Wait
I have a text file with a large number of log messages.
I want to extract the messages between two string patterns. I want the extracted message to appear as it is in the text file.
I tried the following methods. It works, but doesn't support…

Sherzad
- 405
- 4
- 14
1
vote
2 answers
Cannot get file of FormData (angular 13) from Symfony 5.4
I hope you are fine,
I have a problem to get file of FormData in Angular 13 send to Symfony 5.4.
onFileSelected1(event:any){
const file:File = event.target.files[0];
let formData = new FormData();
…

Bilal Mimouni
- 17
- 2
1
vote
4 answers
Powershell Get-Content specific content inside text
I receive a text file with a multiple lists like shown below (edit: more accurate example dataset included)
# SYSTEM X
# SINGULAR
192.168.1.3
# SUB-SYSTEM V
192.168.1.4
192.168.1.5
192.168.1.6
# SYSTEM Y
#…

markfree
- 61
- 6
1
vote
0 answers
Get ImageView content from an Accessibility Service on Android
I am able to get an ImageView as an AccessibilityNodeInfo in my accessibility service but I am not able to get the content of this ImageView. I know on a TextView I can get the content with getText(), but is there a similar function to get content…

Charles
- 21
- 1
- 3
0
votes
0 answers
Getting all information between start and end strings in PowerShell, including the end string
I'm trying to edit a file with powershell, the thing is that I need all the information between two strings, this is currently what I have
$testText = Get-Content C:\Users\Administrator\Documents\test1\test1.txt
$pattern =…